Copilot commented on code in PR #51286:
URL: https://github.com/apache/arrow/pull/51286#discussion_r4232094005
##########
cpp/src/arrow/dataset/file_csv.cc:
##########
@@ -499,6 +504,10 @@ Result<std::shared_ptr<FileWriter>>
CsvFileFormat::MakeWriter(
if (!Equals(*options->format())) {
return Status::TypeError("Mismatching format/write options.");
}
+ if (!parse_options.delimiter_string.empty()) {
+ return Status::NotImplemented(
+ "Writing CSV files with delimiter_string is not supported");
+ }
Review Comment:
`Equals` now treats a one-byte `delimiter_string` as equal to the legacy
`delimiter`, but `MakeWriter` only rejects `delimiter_string` on the format
being written. This lets a format with `delimiter='|'` accept
`DefaultWriteOptions()` from an equal format with `delimiter_string="|"`; those
options set `write_options->delimiter` from the latter's legacy `delimiter`
(`,`), so the writer silently emits comma-delimited output. Reject
delimiter-string write options from `options->format()` as well, or otherwise
make writer-option compatibility account for this equality case.
--
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]