CaptainAni187 commented on code in PR #54683:
URL: https://github.com/apache/arrow/pull/54683#discussion_r4382703780
##########
cpp/src/arrow/csv/writer.cc:
##########
@@ -512,10 +512,15 @@ class CSVWriterImpl : public ipc::RecordBatchWriter {
return Status::Invalid("Null string cannot contain quotes.");
}
+ const std::string null_string_value =
+ schema->num_fields() == 1 && options.null_string.empty() &&
+ options.quoting_style != QuotingStyle::None
Review Comment:
Good point, thanks. A single string or binary column now keeps the empty
line for nulls, since "" is already what a valid empty string becomes there.
The `""` for nulls only applies when the column's values can never be written
as `""` (ints, dates, etc.). Added the round trip you described: ["a", null,
""] written with Needed and AllValid and read back with
strings_can_be_null=true, quoted_strings_can_be_null=false and
ignore_empty_lines=false keeps all three values. Also adjusted the AllValid doc
to point at the exception.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]