viirya commented on code in PR #7854:
URL: https://github.com/apache/arrow-datafusion/pull/7854#discussion_r1368950538
##########
datafusion/common/src/file_options/csv_writer.rs:
##########
@@ -65,29 +57,20 @@ impl TryFrom<(&ConfigOptions, &StatementOptions)> for
CsvWriterOptions {
fn try_from(value: (&ConfigOptions, &StatementOptions)) -> Result<Self> {
let _configs = value.0;
let statement_options = value.1;
- let mut has_header = true;
let mut builder = WriterBuilder::default();
let mut compression = CompressionTypeVariant::UNCOMPRESSED;
for (option, value) in &statement_options.options {
builder = match option.to_lowercase().as_str(){
"header" => {
- has_header = value.parse()
+ let has_header = value.parse()
.map_err(|_|
DataFusionError::Configuration(format!("Unable to parse {value} as bool as
required for {option}!")))?;
- builder.has_headers(has_header)
+ builder.with_header(has_header)
},
"date_format" => builder.with_date_format(value.to_owned()),
"datetime_format" =>
builder.with_datetime_format(value.to_owned()),
"timestamp_format" =>
builder.with_timestamp_format(value.to_owned()),
"time_format" => builder.with_time_format(value.to_owned()),
- "rfc3339" => {
- let value_bool = value.parse()
- .map_err(|_|
DataFusionError::Configuration(format!("Unable to parse {value} as bool as
required for {option}!")))?;
- if value_bool{
- builder.with_rfc3339()
- } else{
- builder
- }
- },
Review Comment:
https://github.com/apache/arrow-rs/pull/4909
--
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]