Skip to content

Commit ee647df

Browse files
committed
test: preserve pre-flip pushdown_filters=false for tests asserting FilterExec-above-scan plans
Three tests captured their expected plans / metrics with pushdown_filters=false default. After flipping that default to true they need to explicitly set the option back for their scope: - parquet::filter_pushdown::predicate_cache_default: config the SessionContext with pushdown_filters=false so the cache-usage assertion (0/0) still holds - sqllogictest/clickbench.slt: SET pushdown_filters=false around the whole file (RESET at end) so ClickBench EXPLAIN plans stay intact - sqllogictest/dynamic_filter_pushdown_config.slt: SET pushdown_filters=false for the default section at the top; the file already SETs true later for the second half — pair it with a RESET at the tail
1 parent 85a9e82 commit ee647df

3 files changed

Lines changed: 24 additions & 2 deletions

File tree

datafusion/core/tests/parquet/filter_pushdown.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,8 +619,12 @@ fn get_value(metrics: &MetricsSet, metric_name: &str) -> usize {
619619

620620
#[tokio::test]
621621
async fn predicate_cache_default() -> datafusion_common::Result<()> {
622-
let ctx = SessionContext::new();
623-
// The cache is on by default, but not used unless filter pushdown is enabled
622+
// Verify the cache is not used when filter pushdown is off.
623+
// `pushdown_filters` defaults to `true` since DataFusion 55, so
624+
// disable it explicitly to exercise the "no pushdown" path.
625+
let mut config = SessionConfig::new();
626+
config.options_mut().execution.parquet.pushdown_filters = false;
627+
let ctx = SessionContext::new_with_config(config);
624628
PredicateCacheTest {
625629
expected_inner_records: 0,
626630
expected_records: 0,

datafusion/sqllogictest/test_files/clickbench.slt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
# Data file made with DuckDB:
2525
# COPY (SELECT * FROM 'hits.parquet' LIMIT 10) TO 'clickbench_hits_10.parquet' (FORMAT PARQUET);
2626

27+
# The EXPLAIN plans in this file were captured with pushdown_filters=false.
28+
# DataFusion 55 flips that default to true; disable it here to keep the plans
29+
# meaningful (filter kept above the scan) rather than absorbed into the scan.
30+
statement ok
31+
set datafusion.execution.parquet.pushdown_filters = false;
32+
2733
statement ok
2834
CREATE EXTERNAL TABLE hits_raw
2935
STORED AS PARQUET
@@ -1238,3 +1244,6 @@ drop view hits;
12381244

12391245
statement ok
12401246
drop table hits_raw;
1247+
1248+
statement ok
1249+
reset datafusion.execution.parquet.pushdown_filters;

datafusion/sqllogictest/test_files/dynamic_filter_pushdown_config.slt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
# - enable_aggregate_dynamic_filter_pushdown (for Aggregate dynamic filters)
2222
# - enable_dynamic_filter_pushdown (controls all three)
2323

24+
# The EXPLAIN plans in the "default" section below expect
25+
# pushdown_filters=false so the dynamic FilterExec stays above the scan.
26+
# DataFusion 55 flipped that default to true; explicitly disable it here.
27+
statement ok
28+
set datafusion.execution.parquet.pushdown_filters = false;
29+
2430
# Setup: Create parquet test files
2531
statement ok
2632
CREATE TABLE test_data(id INT, value INT, name VARCHAR) AS VALUES
@@ -879,3 +885,6 @@ RESET datafusion.execution.parquet.max_row_group_size;
879885

880886
statement ok
881887
RESET datafusion.execution.parquet.pushdown_filter_mode;
888+
889+
statement ok
890+
RESET datafusion.execution.parquet.pushdown_filters;

0 commit comments

Comments
 (0)