Skip to content

Commit 9023c19

Browse files
adriangbclaude
andcommitted
Revert unrelated on_right refactor
Per review feedback, the hoisting of on_right_exprs above the SharedBuildAccumulator init was an unrelated cleanup (same Arc-clone and allocation cost) that distracted from the cancellation fix. Restore the two separate constructions to match main. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c191e57 commit 9023c19

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

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

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,22 +1319,22 @@ 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_exprs = self
1323-
.on
1324-
.iter()
1325-
.map(|(_, right_expr)| Arc::clone(right_expr))
1326-
.collect::<Vec<_>>();
13271322
let build_accumulator = enable_dynamic_filter_pushdown
13281323
.then(|| {
13291324
self.dynamic_filter.as_ref().map(|df| {
13301325
let filter = Arc::clone(&df.filter);
1326+
let on_right = self
1327+
.on
1328+
.iter()
1329+
.map(|(_, right_expr)| Arc::clone(right_expr))
1330+
.collect::<Vec<_>>();
13311331
Some(Arc::clone(df.build_accumulator.get_or_init(|| {
13321332
Arc::new(SharedBuildAccumulator::new_from_partition_mode(
13331333
self.mode,
13341334
self.left.as_ref(),
13351335
self.right.as_ref(),
13361336
filter,
1337-
on_right_exprs.clone(),
1337+
on_right,
13381338
repartition_random_state,
13391339
))
13401340
})))
@@ -1407,10 +1407,16 @@ 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+
14101416
Ok(Box::pin(HashJoinStream::new(
14111417
partition,
14121418
self.schema(),
1413-
on_right_exprs,
1419+
on_right,
14141420
self.filter.clone(),
14151421
self.join_type,
14161422
right_stream,

0 commit comments

Comments
 (0)