Skip to content

Commit e63de8a

Browse files
committed
Minimize hash join dynamic filter diff
1 parent 1076d39 commit e63de8a

1 file changed

Lines changed: 4 additions & 16 deletions

File tree

  • datafusion/physical-plan/src/joins/hash_join

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

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ impl ExecutionPlan for HashJoinExec {
13191319
// Initialize build_accumulator lazily with runtime partition counts (only if enabled)
13201320
// Use RepartitionExec's random state (seeds: 0,0,0,0) for partition routing
13211321
let repartition_random_state = REPARTITION_RANDOM_STATE;
1322-
let on_right = self
1322+
let on_right_exprs = self
13231323
.on
13241324
.iter()
13251325
.map(|(_, right_expr)| Arc::clone(right_expr))
@@ -1334,7 +1334,7 @@ impl ExecutionPlan for HashJoinExec {
13341334
self.left.as_ref(),
13351335
self.right.as_ref(),
13361336
filter,
1337-
on_right.clone(),
1337+
on_right_exprs.clone(),
13381338
repartition_random_state,
13391339
))
13401340
})))
@@ -1407,22 +1407,10 @@ impl ExecutionPlan for HashJoinExec {
14071407
None => self.column_indices.clone(),
14081408
};
14091409

1410-
let on_right = self
1411-
.on
1412-
.iter()
1413-
.map(|(_, right_expr)| Arc::clone(right_expr))
1414-
.collect::<Vec<_>>();
1415-
let stream_build_accumulator = match self.mode {
1416-
PartitionMode::Partitioned | PartitionMode::CollectLeft => build_accumulator,
1417-
PartitionMode::Auto => unreachable!(
1418-
"PartitionMode::Auto should not be present at execution time"
1419-
),
1420-
};
1421-
14221410
Ok(Box::pin(HashJoinStream::new(
14231411
partition,
14241412
self.schema(),
1425-
on_right,
1413+
on_right_exprs,
14261414
self.filter.clone(),
14271415
self.join_type,
14281416
right_stream,
@@ -1435,7 +1423,7 @@ impl ExecutionPlan for HashJoinExec {
14351423
batch_size,
14361424
vec![],
14371425
self.right.output_ordering().is_some(),
1438-
stream_build_accumulator,
1426+
build_accumulator,
14391427
self.mode,
14401428
self.null_aware,
14411429
self.fetch,

0 commit comments

Comments
 (0)