neilconway commented on code in PR #24905:
URL: https://github.com/apache/datafusion/pull/24905#discussion_r3925759015
##########
datafusion/common/src/file_options/parquet_writer.rs:
##########
@@ -251,6 +252,54 @@ impl ParquetOptions {
max_in_list_size: _,
} = self;
+ // The `parquet` crate rejects these values with a panic (`assert!`)
+ // while the properties are being built, so check them here and report
+ // a configuration error instead.
+ if *write_batch_size == 0 {
+ return Err(DataFusionError::Configuration(
+ "datafusion.execution.parquet.write_batch_size must be greater
than 0"
+ .to_string(),
+ ));
+ }
+ if *max_row_group_size == 0 {
+ return Err(DataFusionError::Configuration(
+ "datafusion.execution.parquet.max_row_group_size must be
greater than 0"
+ .to_string(),
+ ));
+ }
+ if *column_index_truncate_length == Some(0) {
+ return Err(DataFusionError::Configuration(
+ "datafusion.execution.parquet.column_index_truncate_length
must be greater than 0 (unset it to disable truncation)"
Review Comment:
Can we remove the embedded whitespace in the error string, please? Here and
below.
--
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]