alamb commented on code in PR #8351:
URL: https://github.com/apache/arrow-datafusion/pull/8351#discussion_r1409203576
##########
datafusion/core/src/datasource/listing_table_factory.rs:
##########
@@ -67,12 +67,23 @@ impl TableProviderFactory for ListingTableFactory {
let file_extension = get_extension(cmd.location.as_str());
let file_format: Arc<dyn FileFormat> = match file_type {
- FileType::CSV => Arc::new(
- CsvFormat::default()
- .with_has_header(cmd.has_header)
- .with_delimiter(cmd.delimiter as u8)
- .with_file_compression_type(file_compression_type),
- ),
+ FileType::CSV => {
+ let mut statement_options =
StatementOptions::from(&cmd.options);
+ let quote = statement_options
+ .take_str_option("quote")
+ .map_or(b'"', |x| x.as_bytes()[0]);
Review Comment:
This effectively overrides the default values in the CSV format.
What would you think about only setting the values if it was different than
the default
Something like
```rust
let mut format = CsvFormat::default();
if let Some(quote) = statement_options.take_str_option("quote") {
format = format.with_quote(quote)
}
...
```
?
--
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]