Skip to content

Commit 5d0d6a4

Browse files
committed
disable HashJoinExec sideways information passing for partitioned queries
1 parent 5c370fa commit 5d0d6a4

File tree

4 files changed

+35
-4
lines changed

4 files changed

+35
-4
lines changed

datafusion/physical-plan/src/joins/hash_join.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -905,8 +905,9 @@ impl ExecutionPlan for HashJoinExec {
905905
reservation,
906906
need_produce_result_in_final(self.join_type),
907907
1,
908-
enable_dynamic_filter_pushdown
909-
.then_some(Arc::clone(&self.dynamic_filter)),
908+
// Disable dynamic filter bounds for partitioned mode to avoid race conditions
909+
// where multiple partitions overwrite each other's bounds
910+
None,
910911
on_right.clone(),
911912
))
912913
}

datafusion/sqllogictest/test_files/push_down_filter.slt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,3 +288,33 @@ physical_plan DataSourceExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/
288288

289289
statement ok
290290
drop table t;
291+
292+
# Regression test for https://github.com/apache/datafusion/issues/17188
293+
query I
294+
COPY (select i as k from generate_series(1, 10000000) as t(i))
295+
TO 'test_files/scratch/push_down_filter/t1.parquet'
296+
STORED AS PARQUET;
297+
----
298+
10000000
299+
300+
query I
301+
COPY (select i as k, i as v from generate_series(1, 10000000) as t(i))
302+
TO 'test_files/scratch/push_down_filter/t2.parquet'
303+
STORED AS PARQUET;
304+
----
305+
10000000
306+
307+
statement ok
308+
create external table t1 stored as parquet location 'test_files/scratch/push_down_filter/t1.parquet';
309+
310+
statement ok
311+
create external table t2 stored as parquet location 'test_files/scratch/push_down_filter/t2.parquet';
312+
313+
query III
314+
select *
315+
from t1
316+
join t2 on t1.k = t2.k
317+
where v = 1 or v = 10000000;
318+
----
319+
1 1 1
320+
10000000 10000000 10000000

0 commit comments

Comments
 (0)