datafusion icon indicating copy to clipboard operation
datafusion copied to clipboard

Invalid parquet writer options (e.g. `max_row_group_size = 0`, `bloom_filter_fpp = 1.5`) panic in `COPY` instead of returning an error

Open edubraqd opened this issue 3 months ago • 2 comments

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

SET datafusion.execution.parquet.max_row_group_size = 0;
COPY (SELECT 1) TO 'x.parquet';
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
SET datafusion.execution.parquet.bloom_filter_fpp = 1.5;   -- also 0, 1, -1, NaN
COPY (SELECT 1) TO 'x.parquet';
thread 'main' panicked at parquet-59.2.0/src/file/properties.rs:1665:13:
bloom filter fpp must be between 0 and 1 (exclusive) ...
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.

edubraqd avatar Sep 03 '26 03:09 edubraqd

take

tripleaceme avatar Oct 18 '26 13:10 tripleaceme

untake

tripleaceme avatar Oct 21 '26 18:10 tripleaceme