You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add quote style and trimming to csv writier (#20813)
## Which issue does this PR close?
- Closes#10669
Related arrow-rs PRs apache/arrow-rs#8960 and
apache/arrow-rs#9004
## Rationale for this change
The CSV writer was missing support for `quote_style`,
`ignore_leading_whitespace`, and `ignore_trailing_whitespace` options
that are available on the underlying arrow `WriterBuilder`. This meant
users couldn't control quoting behaviour or whitespace trimming when
writing CSV files.
## What changes are included in this PR?
Adds three new CSV writer options wired through the full stack:
- `quote_style` — controls when fields are quoted (`Always`,
`Necessary`, `NonNumeric`, `Never`). Modelled as a protobuf enum
(`CsvQuoteStyle`).
- `ignore_leading_whitespace` — trims leading whitespace from string
values on write.
- `ignore_trailing_whitespace` — trims trailing whitespace from string
values on write.
## Are these changes tested?
Yes — sqllogictest coverage added in `csv_files.slt`
## Are there any user-facing changes?
Three new `format.*` options available in COPY TO and CREATE EXTERNAL
TABLE for CSV:
- `format.quote_style` (string: `Always`, `Necessary`, `NonNumeric`,
`Never`)
- `format.ignore_leading_whitespace` (boolean)
- `format.ignore_trailing_whitespace` (boolean)
0 commit comments