-
Notifications
You must be signed in to change notification settings - Fork 4k
GH-35190: [Go] Correctly handle null values in CSV reader #35191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
| func (r *Reader) parseBinaryType(field array.Builder, str string) { | ||
| // specialize the implementation when we know we cannot have nulls | ||
| if str != "" && r.isNull(str) { | ||
| if r.isNull(str) { | ||
| field.AppendNull() | ||
| return | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we currently have a test that verifies you can still get an empty string if it is not in the list of Null values? / stringsCanBeNull == false ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think not, but happy to add one here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added two new test cases for this
This updates the Arrow dependency to the latest `cqmain` branch commit, which includes apache/arrow#35191 and apache/arrow#35189
…he#35191) The way the CSV reader handles null values currently makes it impossible for empty strings to be interpreted as null, even when this is explicitly enabled through the `csv.WithNullReader(stringsCanBeNull: true, "", "NULL", "null")` option. This change fixes this. * Closes: apache#35190 Authored-by: Herman Schaaf <[email protected]> Signed-off-by: Matt Topol <[email protected]>
…he#35191) The way the CSV reader handles null values currently makes it impossible for empty strings to be interpreted as null, even when this is explicitly enabled through the `csv.WithNullReader(stringsCanBeNull: true, "", "NULL", "null")` option. This change fixes this. * Closes: apache#35190 Authored-by: Herman Schaaf <[email protected]> Signed-off-by: Matt Topol <[email protected]>
The way the CSV reader handles null values currently makes it impossible for empty strings to be interpreted as null, even when this is explicitly enabled through the
csv.WithNullReader(stringsCanBeNull: true, "", "NULL", "null")option. This change fixes this.