-
Notifications
You must be signed in to change notification settings - Fork 4.1k
import into: give hint when NULL cannot be parsed due to whitespaces. #83723
Copy link
Copy link
Closed
Labels
C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)E-starterMight be suitable for a starter project for new employees or team members.Might be suitable for a starter project for new employees or team members.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Description
Steps to reproduce:
- Make a csv and insert with values
> touch ~/local/1/data/extern/test.csv
> echo "'adidas', NULL" > ~/local/1/data/extern/test.csv- Import the data from the local csv to the table
> CREATE TABLE test(a string, x bool);
> IMPORT INTO test(a, x) CSV DATA ("nodelocal://1/test.csv") WITH nullif="NULL";
ERROR: nodelocal://1/test.csv: error parsing row 1: parse "x" as BOOL: could not parse "NULL" as type bool: invalid bool value (row: 'adidas', NULL)
The reason is that NULL cannot be parsed due to the whitespace. Adding a hint would make this more obvious and likely save a lot of time.
The solution here would be to specify nullif=' NULL'
Jira issue: CRDB-17225
Epic CRDB-17785
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)E-starterMight be suitable for a starter project for new employees or team members.Might be suitable for a starter project for new employees or team members.T-sql-foundationsSQL Foundations Team (formerly SQL Schema + SQL Sessions)SQL Foundations Team (formerly SQL Schema + SQL Sessions)