Repository navigation
fix: preserve COPY TO format options during plan serialization - #27825
Open
Ilhan-Personal wants to merge 3 commits into
Open
Ilhan-Personal wants to merge 3 commits into
Ilhan-Personal wants to merge 3 commits into
Conversation
Ilhan-Personal
force-pushed
the
ilu/preserve-copy-top-options
branch
from
November 28, 2026 13:47
871106d to
5aa52b7
Compare
Ilhan-Personal
commented
Nov 28, 2026
| let mut parquet_options = parquet_options.clone(); | ||
| for (k, v) in format_options { | ||
| parquet_options.set(k, v)?; | ||
| parquet_options.set(k.strip_prefix("format.").unwrap_or(k), v)?; |
Author
There was a problem hiding this comment.
I couldn't find an existing constant to reuse here
the SQL planner builds keys with format!("format.{key}") so I'm just following existing convention
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Fork CI setup: For pull requests from a fork to
main, enable workflows in your fork's Actions tab before you push.See the fork CI setup guide.
Which issue does this PR close?
Related to apache/datafusion-ballista#2966.
Rationale for this change
The same
COPY TO CSVstatement can write different files depending on how it runs. For example, a user who requests no header and no quotes gets the expected output when running DataFusion directly. When Ballista sends the query to its scheduler, the file includes a header and every field is quoted. The CSV should honor the user’s settings in both cases. See apache/datafusion-ballista#2966.What changes are included in this PR?
has_headerforformat.has_header.execution.keep_partition_by_columnsin the planner so file writers don’t reject it as an unknown option.What is the testing strategy for this PR?
The regression test executes the same
COPYplan directly and after a protobuf round trip, then compares the CSV files byte for byte. It covers default quoting,Neverwith headers disabled,NonNumeric, andexecution.keep_partition_by_columns. A separate assertion checks that an explicitly configuredAlwaysquote style survives serialisation.Are there any user-facing changes?
Yes. A serialized
COPY TO CSVplan now writes the same header and quoting as direct execution. For example,format.has_header = falseandformat.quote_style = Neverproduce an unquoted data row with no header in both cases.