@@ -1569,15 +1569,13 @@ Projection: join_t1.t1_id, join_t2.t2_id, join_t1.t1_name
15691569----TableScan: join_t1 projection=[t1_id, t1_name]
15701570----TableScan: join_t2 projection=[t2_id]
15711571physical_plan
1572- ProjectionExec: expr=[t1_id@0 as t1_id, t2_id@3 as t2_id, t1_name@1 as t1_name]
1572+ ProjectionExec: expr=[t1_id@1 as t1_id, t2_id@0 as t2_id, t1_name@2 as t1_name]
15731573--CoalesceBatchesExec: target_batch_size=2
1574- ----HashJoinExec: mode=CollectLeft, join_type=Inner, on=[(join_t1.t1_id + UInt32(11)@2, t2_id@0)]
1575- ------CoalescePartitionsExec
1576- --------ProjectionExec: expr=[t1_id@0 as t1_id, t1_name@1 as t1_name, t1_id@0 + 11 as join_t1.t1_id + UInt32(11)]
1577- ----------RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1
1578- ------------MemoryExec: partitions=1, partition_sizes=[1]
1579- ------RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1
1580- --------MemoryExec: partitions=1, partition_sizes=[1]
1574+ ----HashJoinExec: mode=CollectLeft, join_type=Inner, on=[(t2_id@0, join_t1.t1_id + UInt32(11)@2)]
1575+ ------MemoryExec: partitions=1, partition_sizes=[1]
1576+ ------ProjectionExec: expr=[t1_id@0 as t1_id, t1_name@1 as t1_name, t1_id@0 + 11 as join_t1.t1_id + UInt32(11)]
1577+ --------RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1
1578+ ----------MemoryExec: partitions=1, partition_sizes=[1]
15811579
15821580statement ok
15831581set datafusion.optimizer.repartition_joins = true;
@@ -1595,18 +1593,18 @@ Projection: join_t1.t1_id, join_t2.t2_id, join_t1.t1_name
15951593----TableScan: join_t1 projection=[t1_id, t1_name]
15961594----TableScan: join_t2 projection=[t2_id]
15971595physical_plan
1598- ProjectionExec: expr=[t1_id@0 as t1_id, t2_id@3 as t2_id, t1_name@1 as t1_name]
1596+ ProjectionExec: expr=[t1_id@1 as t1_id, t2_id@0 as t2_id, t1_name@2 as t1_name]
15991597--CoalesceBatchesExec: target_batch_size=2
1600- ----HashJoinExec: mode=Partitioned, join_type=Inner, on=[(join_t1.t1_id + UInt32(11)@2, t2_id@0)]
1598+ ----HashJoinExec: mode=Partitioned, join_type=Inner, on=[(t2_id@0, join_t1.t1_id + UInt32(11)@2)]
1599+ ------CoalesceBatchesExec: target_batch_size=2
1600+ --------RepartitionExec: partitioning=Hash([t2_id@0], 2), input_partitions=2
1601+ ----------RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1
1602+ ------------MemoryExec: partitions=1, partition_sizes=[1]
16011603------CoalesceBatchesExec: target_batch_size=2
16021604--------RepartitionExec: partitioning=Hash([join_t1.t1_id + UInt32(11)@2], 2), input_partitions=2
16031605----------ProjectionExec: expr=[t1_id@0 as t1_id, t1_name@1 as t1_name, t1_id@0 + 11 as join_t1.t1_id + UInt32(11)]
16041606------------RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1
16051607--------------MemoryExec: partitions=1, partition_sizes=[1]
1606- ------CoalesceBatchesExec: target_batch_size=2
1607- --------RepartitionExec: partitioning=Hash([t2_id@0], 2), input_partitions=2
1608- ----------RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1
1609- ------------MemoryExec: partitions=1, partition_sizes=[1]
16101608
16111609# Right side expr key inner join
16121610
@@ -2821,13 +2819,13 @@ physical_plan
28212819SortPreservingMergeExec: [t1_id@0 ASC NULLS LAST]
28222820--SortExec: expr=[t1_id@0 ASC NULLS LAST]
28232821----CoalesceBatchesExec: target_batch_size=2
2824- ------HashJoinExec: mode=Partitioned, join_type=LeftSemi , on=[(t1_id @0, t2_id @0)]
2822+ ------HashJoinExec: mode=Partitioned, join_type=RightSemi , on=[(t2_id @0, t1_id @0)]
28252823--------CoalesceBatchesExec: target_batch_size=2
2826- ----------RepartitionExec: partitioning=Hash([t1_id @0], 2), input_partitions=2
2824+ ----------RepartitionExec: partitioning=Hash([t2_id @0], 2), input_partitions=2
28272825------------RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1
28282826--------------MemoryExec: partitions=1, partition_sizes=[1]
28292827--------CoalesceBatchesExec: target_batch_size=2
2830- ----------RepartitionExec: partitioning=Hash([t2_id @0], 2), input_partitions=2
2828+ ----------RepartitionExec: partitioning=Hash([t1_id @0], 2), input_partitions=2
28312829------------RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1
28322830--------------MemoryExec: partitions=1, partition_sizes=[1]
28332831
@@ -2862,13 +2860,13 @@ physical_plan
28622860SortPreservingMergeExec: [t1_id@0 ASC NULLS LAST]
28632861--SortExec: expr=[t1_id@0 ASC NULLS LAST]
28642862----CoalesceBatchesExec: target_batch_size=2
2865- ------HashJoinExec: mode=Partitioned, join_type=LeftSemi , on=[(t1_id @0, t2_id @0)]
2863+ ------HashJoinExec: mode=Partitioned, join_type=RightSemi , on=[(t2_id @0, t1_id @0)]
28662864--------CoalesceBatchesExec: target_batch_size=2
2867- ----------RepartitionExec: partitioning=Hash([t1_id @0], 2), input_partitions=2
2865+ ----------RepartitionExec: partitioning=Hash([t2_id @0], 2), input_partitions=2
28682866------------RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1
28692867--------------MemoryExec: partitions=1, partition_sizes=[1]
28702868--------CoalesceBatchesExec: target_batch_size=2
2871- ----------RepartitionExec: partitioning=Hash([t2_id @0], 2), input_partitions=2
2869+ ----------RepartitionExec: partitioning=Hash([t1_id @0], 2), input_partitions=2
28722870------------RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1
28732871--------------MemoryExec: partitions=1, partition_sizes=[1]
28742872
@@ -2924,7 +2922,7 @@ physical_plan
29242922SortPreservingMergeExec: [t1_id@0 ASC NULLS LAST]
29252923--SortExec: expr=[t1_id@0 ASC NULLS LAST]
29262924----CoalesceBatchesExec: target_batch_size=2
2927- ------HashJoinExec: mode=CollectLeft, join_type=LeftSemi , on=[(t1_id @0, t2_id @0)]
2925+ ------HashJoinExec: mode=CollectLeft, join_type=RightSemi , on=[(t2_id @0, t1_id @0)]
29282926--------MemoryExec: partitions=1, partition_sizes=[1]
29292927--------RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1
29302928----------MemoryExec: partitions=1, partition_sizes=[1]
@@ -2960,7 +2958,7 @@ physical_plan
29602958SortPreservingMergeExec: [t1_id@0 ASC NULLS LAST]
29612959--SortExec: expr=[t1_id@0 ASC NULLS LAST]
29622960----CoalesceBatchesExec: target_batch_size=2
2963- ------HashJoinExec: mode=CollectLeft, join_type=LeftSemi , on=[(t1_id @0, t2_id @0)]
2961+ ------HashJoinExec: mode=CollectLeft, join_type=RightSemi , on=[(t2_id @0, t1_id @0)]
29642962--------MemoryExec: partitions=1, partition_sizes=[1]
29652963--------RepartitionExec: partitioning=RoundRobinBatch(2), input_partitions=1
29662964----------MemoryExec: partitions=1, partition_sizes=[1]
0 commit comments