NoahKusaba opened a new issue, #2966:
URL: https://github.com/apache/datafusion-ballista/issues/2966
**Describe the bug**
`COPY … TO … STORED AS CSV OPTIONS (…)` ignores the CSV format options on
Ballista. It always writes a header and quotes every field. This happens with
both planners.
**To Reproduce**
Standalone Ballista on `main` (446fa54c9), default settings:
```sql
COPY (SELECT * FROM (VALUES (1, 'hello', 1.1), (2, 'comma,value', 2.2))
t(id, s, f))
TO '/tmp/c.csv' STORED AS CSV
OPTIONS ('format.has_header' 'false', 'format.quote_style' 'Never');
```
Ballista writes:
```
"id","s","f"
"1","hello","1.1"
"2","comma,value","2.2"
```
`'format.has_header' 'true'` with the default quote style, and
`'format.quote_style' 'NonNumeric'`, give the same output.
**Expected behavior**
As DataFusion writes it: no header and no quotes here; with `NonNumeric`,
only the string fields quoted; with the defaults, `1,hello,1.1`.
**Additional context**
Found by running DataFusion's sqllogictest files on Ballista (#2945):
`csv_files.slt` 465, 494, 534, 560 and 588 (quote style and trimming).
DataFusion's proto has these options (`CsvOptions.quote_style`, `has_header`),
so they are probably lost on Ballista's side. #2781 lists "CSV writer quotes
every field when `with_header=True`" for the Python client, which is probably
the same bug.
--
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]