Skip to content

Commit 537fc50

Browse files
viiryaclaude
andcommitted
fix: Force CollectLeft in physical planner for null-aware joins
Added an additional check in the physical planner to prevent null-aware anti joins from using PartitionMode::Auto. This ensures they use PartitionMode::CollectLeft from the start, before any optimizer passes. The issue: Even with the fix in join_selection.rs, the physical planner was creating null-aware joins with PartitionMode::Auto when target_partitions > 1 and repartition_joins is enabled (common in CI). The fix: Added `&& !*null_aware` condition to the partition mode decision in the physical planner, forcing null-aware joins to skip the Auto mode and go directly to CollectLeft. This provides defense-in-depth: 1. Physical planner: Creates with CollectLeft initially 2. Join selection optimizer: Ensures it stays CollectLeft 3. Stream execution: Has per-partition tracking as backup 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent cbd1b15 commit 537fc50

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

datafusion/core/src/physical_planner.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,6 +1488,7 @@ impl DefaultPhysicalPlanner {
14881488
} else if session_state.config().target_partitions() > 1
14891489
&& session_state.config().repartition_joins()
14901490
&& prefer_hash_join
1491+
&& !*null_aware // Null-aware joins must use CollectLeft
14911492
{
14921493
Arc::new(HashJoinExec::try_new(
14931494
physical_left,

0 commit comments

Comments
 (0)