Ilhan-Personal opened a new pull request, #27825:
URL: https://github.com/apache/datafusion/pull/27825

   > [!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](https://datafusion.apache.org/contributor-guide/#pull-requests-from-forks).
   
   ## Which issue does this PR close?
   
   
   
   - Closes https://github.com/apache/datafusion/issues/27824
   
   Related to 
[apache/datafusion-ballista#2966](https://github.com/apache/datafusion-ballista/issues/2966).
   
   ## Rationale for this change
   
   The same `COPY TO CSV` statement 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](https://github.com/apache/datafusion-ballista/issues/2966).
   
   
   ## What changes are included in this PR?
   
   - Preserve the selected CSV quoting mode when sending a plan. Previously, 
“quote only when needed” could become “quote every field.”
   - Pass SQL format options to CSV, JSON, and Parquet writers using the names 
they expect, such as `has_header` for `format.has_header`.
   - Handle `execution.keep_partition_by_columns` in 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 `COPY` plan directly and after a 
protobuf round trip, then compares the CSV files byte for byte. It covers 
default quoting, `Never` with headers disabled, `NonNumeric`, and 
`execution.keep_partition_by_columns`. A separate assertion checks that an 
explicitly configured `Always` quote style survives serialisation.
   
   ## Are there any user-facing changes?
   
   Yes. A serialized `COPY TO CSV` plan now writes the same header and quoting 
as direct execution. For example, `format.has_header = false` and 
`format.quote_style = Never` produce an unquoted data row with no header in 
both cases.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to