Skip to content

Commit 25db070

Browse files
committed
feat: flip pushdown_filters default to true
DataFusion 55 defaults pushdown_filters to true so filter pushdown into the Parquet scan is on out of the box. The new pushdown_filter_mode=auto (heuristic) prevents narrow-projection regressions that motivated the previous conservative default. Updates: - config.rs: default false -> true - upgrade guide: add section on the flip + how to opt out - configs.md / information_schema.slt: reflect new default - parquet_filter_pushdown.slt: cleanup section now RESETs instead of assuming the pre-flip default of false
1 parent 09886aa commit 25db070

5 files changed

Lines changed: 30 additions & 5 deletions

File tree

datafusion/common/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ config_namespace! {
12011201

12021202
/// (reading) If true, filter expressions are be applied during the parquet decoding operation to
12031203
/// reduce the number of rows decoded. This optimization is sometimes called "late materialization".
1204-
pub pushdown_filters: bool, default = false
1204+
pub pushdown_filters: bool, default = true
12051205

12061206
/// (reading) When `pushdown_filters` is enabled, determines how DataFusion
12071207
/// pushes each filter into the Parquet scan. Options are `auto` (the default)

datafusion/sqllogictest/test_files/information_schema.slt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ datafusion.execution.parquet.maximum_parallel_row_group_writers 1
261261
datafusion.execution.parquet.metadata_size_hint 524288
262262
datafusion.execution.parquet.pruning true
263263
datafusion.execution.parquet.pushdown_filter_mode auto
264-
datafusion.execution.parquet.pushdown_filters false
264+
datafusion.execution.parquet.pushdown_filters true
265265
datafusion.execution.parquet.reorder_filters false
266266
datafusion.execution.parquet.schema_force_view_types true
267267
datafusion.execution.parquet.skip_arrow_metadata false
@@ -421,7 +421,7 @@ datafusion.execution.parquet.maximum_parallel_row_group_writers 1 (writing) By d
421421
datafusion.execution.parquet.metadata_size_hint 524288 (reading) If specified, the parquet reader will try and fetch the last `size_hint` bytes of the parquet file optimistically. If not specified, two reads are required: One read to fetch the 8-byte parquet footer and another to fetch the metadata length encoded in the footer Default setting to 512 KiB, which should be sufficient for most parquet files, it can reduce one I/O operation per parquet file. If the metadata is larger than the hint, two reads will still be performed.
422422
datafusion.execution.parquet.pruning true (reading) If true, the parquet reader attempts to skip entire row groups based on the predicate in the query and the metadata (min/max values) stored in the parquet file
423423
datafusion.execution.parquet.pushdown_filter_mode auto (reading) When `pushdown_filters` is enabled, determines how DataFusion pushes each filter into the Parquet scan. Options are `auto` (the default) `always`, and `heurstic` (plan time heuristic).
424-
datafusion.execution.parquet.pushdown_filters false (reading) If true, filter expressions are be applied during the parquet decoding operation to reduce the number of rows decoded. This optimization is sometimes called "late materialization".
424+
datafusion.execution.parquet.pushdown_filters true (reading) If true, filter expressions are be applied during the parquet decoding operation to reduce the number of rows decoded. This optimization is sometimes called "late materialization".
425425
datafusion.execution.parquet.reorder_filters false (reading) If true, filter expressions evaluated during the parquet decoding operation will be reordered heuristically to minimize the cost of evaluation. If false, the filters are applied in the same order as written in the query
426426
datafusion.execution.parquet.schema_force_view_types true (reading) If true, parquet reader will read columns of `Utf8/Utf8Large` with `Utf8View`, and `Binary/BinaryLarge` with `BinaryView`.
427427
datafusion.execution.parquet.skip_arrow_metadata false (writing) Skip encoding the embedded arrow metadata in the KV_meta This is analogous to the `ArrowWriterOptions::with_skip_arrow_metadata`. Refer to <https://docs.rs/parquet/53.3.0/parquet/arrow/arrow_writer/struct.ArrowWriterOptions.html#method.with_skip_arrow_metadata>

datafusion/sqllogictest/test_files/parquet_filter_pushdown.slt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ A 78
939939

940940
# Cleanup
941941
statement ok
942-
set datafusion.execution.parquet.pushdown_filters = false;
942+
RESET datafusion.execution.parquet.pushdown_filters;
943943

944944
statement ok
945945
set datafusion.execution.parquet.reorder_filters = false;

docs/source/library-user-guide/upgrading/55.0.0.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,37 @@ if tracking.contains_dynamic_filter() {
275275
}
276276
```
277277

278+
### Parquet `pushdown_filters` default is now `true`
279+
280+
`datafusion.execution.parquet.pushdown_filters` now defaults to `true`. In
281+
DataFusion 54 and earlier the default was `false`, so filters were only pushed
282+
into the Parquet scan when the user (or a downstream framework) explicitly
283+
enabled the option. Together with the new `pushdown_filter_mode` option
284+
described below, enabling pushdown by default is a net win on the ClickBench
285+
benchmark suite.
286+
287+
To restore the pre-55 behavior, set `pushdown_filters = false` (either per
288+
session or in `SessionConfig`):
289+
290+
```sql
291+
SET datafusion.execution.parquet.pushdown_filters = false;
292+
```
293+
278294
### New `pushdown_filter_mode` option for Parquet filter pushdown
279295

280296
DataFusion 55 adds a new option,
281297
`datafusion.execution.parquet.pushdown_filter_mode`, that controls how filters
282298
are pushed into Parquet scans when `pushdown_filters` is enabled. It accepts:
283299

300+
- `auto` (default) — currently equivalent to `heuristic`; may evolve as more
301+
sophisticated placement strategies are implemented
302+
(see [issue #22883](https://github.com/apache/datafusion/issues/22883)).
303+
- `always` — unconditionally push every filter into the scan (the DataFusion 54
304+
behavior when `pushdown_filters = true`).
305+
- `heuristic` — apply a plan-time heuristic that declines pushdown for
306+
narrow-projection queries where the `RowFilter` overhead tends to outweigh
307+
the decode it would save (for example `SELECT col1 FROM t WHERE col1 <> ''`).
308+
284309
Because the default is `auto`, enabling `pushdown_filters` no longer guarantees
285310
that **every** filter is pushed into the scan as was the case in DataFusion 54
286311
and earlier. To get the old behavior, also set `pushdown_filter_mode = always`:

docs/source/user-guide/configs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ The following configuration settings are available:
8484
| datafusion.execution.parquet.pruning | true | (reading) If true, the parquet reader attempts to skip entire row groups based on the predicate in the query and the metadata (min/max values) stored in the parquet file |
8585
| datafusion.execution.parquet.skip_metadata | true | (reading) If true, the parquet reader skip the optional embedded metadata that may be in the file Schema. This setting can help avoid schema conflicts when querying multiple parquet files with schemas containing compatible types but different metadata |
8686
| datafusion.execution.parquet.metadata_size_hint | 524288 | (reading) If specified, the parquet reader will try and fetch the last `size_hint` bytes of the parquet file optimistically. If not specified, two reads are required: One read to fetch the 8-byte parquet footer and another to fetch the metadata length encoded in the footer Default setting to 512 KiB, which should be sufficient for most parquet files, it can reduce one I/O operation per parquet file. If the metadata is larger than the hint, two reads will still be performed. |
87-
| datafusion.execution.parquet.pushdown_filters | false | (reading) If true, filter expressions are be applied during the parquet decoding operation to reduce the number of rows decoded. This optimization is sometimes called "late materialization". |
87+
| datafusion.execution.parquet.pushdown_filters | true | (reading) If true, filter expressions are be applied during the parquet decoding operation to reduce the number of rows decoded. This optimization is sometimes called "late materialization". |
8888
| datafusion.execution.parquet.pushdown_filter_mode | auto | (reading) When `pushdown_filters` is enabled, determines how DataFusion pushes each filter into the Parquet scan. Options are `auto` (the default) `always`, and `heurstic` (plan time heuristic). |
8989
| datafusion.execution.parquet.reorder_filters | false | (reading) If true, filter expressions evaluated during the parquet decoding operation will be reordered heuristically to minimize the cost of evaluation. If false, the filters are applied in the same order as written in the query |
9090
| datafusion.execution.parquet.force_filter_selections | false | (reading) Force the use of RowSelections for filter results, when pushdown_filters is enabled. If false, the reader will automatically choose between a RowSelection and a Bitmap based on the number and pattern of selected rows. |

0 commit comments

Comments
 (0)