Skip to content

Commit

Permalink
Add serde support for CSV FileTypeWriterOptions (#8641)
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove authored Dec 28, 2023
1 parent fba5cc0 commit f39c040
Show file tree
Hide file tree
Showing 6 changed files with 406 additions and 4 deletions.
18 changes: 18 additions & 0 deletions datafusion/proto/proto/datafusion.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,7 @@ message FileTypeWriterOptions {
oneof FileType {
JsonWriterOptions json_options = 1;
ParquetWriterOptions parquet_options = 2;
CsvWriterOptions csv_options = 3;
}
}

Expand All @@ -1218,6 +1219,23 @@ message ParquetWriterOptions {
WriterProperties writer_properties = 1;
}

message CsvWriterOptions {
// Optional column delimiter. Defaults to `b','`
string delimiter = 1;
// Whether to write column names as file headers. Defaults to `true`
bool has_header = 2;
// Optional date format for date arrays
string date_format = 3;
// Optional datetime format for datetime arrays
string datetime_format = 4;
// Optional timestamp format for timestamp arrays
string timestamp_format = 5;
// Optional time format for time arrays
string time_format = 6;
// Optional value to represent null
string null_value = 7;
}

message WriterProperties {
uint64 data_page_size_limit = 1;
uint64 dictionary_page_size_limit = 2;
Expand Down
213 changes: 213 additions & 0 deletions datafusion/proto/src/generated/pbjson.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 28 additions & 1 deletion datafusion/proto/src/generated/prost.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f39c040

Please sign in to comment.