edubraqd opened a new issue, #24904:
URL: https://github.com/apache/datafusion/issues/24904

   ### Describe the bug
   
   `ParquetOptions::into_writer_properties_builder` 
(`datafusion/common/src/file_options/parquet_writer.rs`) passes the session 
options straight to the `parquet` crate's `WriterPropertiesBuilder`. Several of 
its setters `assert!` on values they cannot accept, so an invalid `SET` turns 
the next parquet write into a panic (or a hang) instead of a configuration 
error.
   
   ### To Reproduce
   
   ```sql
   SET datafusion.execution.parquet.max_row_group_size = 0;
   COPY (SELECT 1) TO 'x.parquet';
   ```
   
   ```text
   thread 'main' panicked at parquet-59.2.0/src/file/properties.rs:756:9:
   assertion `left != right` failed: Cannot have a 0 max row group row count
   ```
   
   ```sql
   SET datafusion.execution.parquet.bloom_filter_fpp = 1.5;   -- also 0, 1, -1, 
NaN
   COPY (SELECT 1) TO 'x.parquet';
   ```
   
   ```text
   thread 'main' panicked at parquet-59.2.0/src/file/properties.rs:1665:13:
   bloom filter fpp must be between 0 and 1 (exclusive) ...
   ```
   
   ```sql
   SET datafusion.execution.parquet.write_batch_size = 0;
   COPY (SELECT 1) TO 'x.parquet';   -- never returns
   ```
   
   The same applies to `column_index_truncate_length = 0`, 
`statistics_truncate_length = 0`, a per-column `bloom_filter_fpp`, and 
`content_defined_chunking.min_chunk_size = 0` / `max_chunk_size <= 
min_chunk_size`.
   
   ### Expected behavior
   
   A configuration error naming the option, like the existing handling of an 
unknown `compression` or `encoding` string in the same function.
   
   ### Additional context
   
   Found while running a corpus of extreme configuration values against a debug 
build of `datafusion-cli`.
   


-- 
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]

Reply via email to