Copilot commented on code in PR #51286:
URL: https://github.com/apache/arrow/pull/51286#discussion_r3979478034


##########
cpp/src/arrow/dataset/file_csv.cc:
##########
@@ -373,6 +373,7 @@ bool CsvFileFormat::Equals(const FileFormat& format) const {
       checked_cast<const CsvFileFormat&>(format).parse_options;
 
   return parse_options.delimiter == other_parse_options.delimiter &&
+         parse_options.delimiter_string == 
other_parse_options.delimiter_string &&
          parse_options.quoting == other_parse_options.quoting &&

Review Comment:
   CsvFileFormat::Equals compares `parse_options.delimiter` even when 
`delimiter_string` is set, but `delimiter_string` is documented to override 
`delimiter`. This can make two formats behave identically at runtime yet 
compare as not equal (e.g. same `delimiter_string` but different `delimiter`), 
which can break option/format matching and caching logic. Consider comparing 
the effective delimiter instead: compare `delimiter_string` when either side 
sets it, otherwise compare `delimiter`.



-- 
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]

Reply via email to