Skip to content

sql/importer: add hints on null value import failure for CSV files#87443

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
andyyang890:import_into_null
Sep 7, 2022
Merged

sql/importer: add hints on null value import failure for CSV files#87443
craig[bot] merged 1 commit intocockroachdb:masterfrom
andyyang890:import_into_null

Conversation

@andyyang890
Copy link
Copy Markdown
Collaborator

@andyyang890 andyyang890 commented Sep 6, 2022

This patch adds hints notifying the user when an IMPORT INTO ... CSV DATA
command fails due to null values in the CSV file having leading or trailing
whitespace or being quoted when the allow_quoted_null option is not set.

Fixes #83723

Release justification: low risk, high benefit changes to existing functionality

Release note (sql change): A hint is now provided when importing from a CSV file fails because a null value has leading or trailing whitespace or because a value is quoted when the allow_quoted_null option is not set.

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@andyyang890 andyyang890 force-pushed the import_into_null branch 3 times, most recently from 5a569b3 to fccee16 Compare September 7, 2022 14:45
@andyyang890 andyyang890 changed the title sql/importer: add hint on null value import failure for CSV files sql/importer: add hints on null value import failure for CSV files Sep 7, 2022
@andyyang890 andyyang890 requested a review from a team September 7, 2022 14:50
@andyyang890 andyyang890 marked this pull request as ready for review September 7, 2022 14:50
@andyyang890 andyyang890 requested review from a team and msbutler September 7, 2022 14:50
@ZhouXing19
Copy link
Copy Markdown
Collaborator

Nice work, LGTM! Just added a nit.

This patch adds hints notifying the user when an `IMPORT INTO ... CSV DATA`
command fails due to null values in the CSV file having leading or trailing
whitespace or being quoted when the `allow_quoted_null` option is not set.

Fixes cockroachdb#83723

Release justification: low risk, high benefit changes to existing functionality

Release note (sql change): A hint will now be provided when importing from a
CSV file fails due to null values having leading or trailing whitespace or
being quoted when the `allow_quoted_null` option is not set.
Copy link
Copy Markdown
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work

Reviewed 1 of 2 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @msbutler and @ZhouXing19)

@andyyang890
Copy link
Copy Markdown
Collaborator Author

TFTR!

bors r=rafiss,ZhouXing19

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Sep 7, 2022

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

import into: give hint when NULL cannot be parsed due to whitespaces.

4 participants