Skip to content

Commit

Permalink
optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
Lordworms committed Jul 23, 2024
1 parent 8d831df commit 8033893
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions datafusion/proto/src/logical_plan/file_formats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ impl CsvOptionsProto {
time_format: options.time_format.clone().unwrap_or_default(),
null_value: options.null_value.clone().unwrap_or_default(),
comment: options.comment.map_or(vec![], |v| vec![v]),
newlines_in_values: options
.newlines_in_values
.map_or(vec![], |v| vec![v as u8]),
}
} else {
CsvOptionsProto::default()
Expand Down Expand Up @@ -129,6 +132,11 @@ impl From<&CsvOptionsProto> for CsvOptions {
} else {
None
},
newlines_in_values: if proto.newlines_in_values.is_empty() {
None
} else {
Some(proto.newlines_in_values[0] != 0)
},
}
}
}
Expand Down

0 comments on commit 8033893

Please sign in to comment.