@@ -403,8 +403,9 @@ statement ok
403403DROP TABLE t2;
404404
405405# A non-equality correlation leaves one key and a residual join filter. The
406- # null-aware `LeftAnti` hash join applies the residual filter when it looks
407- # for UNKNOWN rows. For `k = 1` the key is NULL and the correlated subquery
406+ # null-aware anti hash join (here swapped to a `RightAnti` that builds on the
407+ # smaller subquery) applies the residual filter when it looks for UNKNOWN
408+ # rows. For `k = 1` the key is NULL and the correlated subquery
408409# result is empty, and `NULL NOT IN (<empty set>)` is TRUE. Both rows are
409410# correct.
410411statement ok
@@ -438,10 +439,10 @@ logical_plan
43843905)------Projection: CAST(rb.k AS Int64), rb.z
43944006)--------TableScan: rb projection=[k, z]
440441physical_plan
441- 01)HashJoinExec: mode=CollectLeft, join_type=LeftAnti , on=[(nullif(ra.k,Int64(1))@2, rb.k@0 )], filter=z@1 > z@0, projection=[k@0], null_aware
442- 02)--ProjectionExec: expr=[k@0 as k, z@1 as z, nullif( CAST(k@0 AS Int64), 1) as nullif(ra .k,Int64(1)) ]
442+ 01)HashJoinExec: mode=CollectLeft, join_type=RightAnti , on=[(rb.k@0, nullif(ra.k,Int64(1))@2)], filter=z@1 > z@0, projection=[k@0], null_aware
443+ 02)--ProjectionExec: expr=[CAST(k@0 AS Int64) as rb .k, z@1 as z ]
44344403)----DataSourceExec: partitions=1, partition_sizes=[1]
444- 04)--ProjectionExec: expr=[CAST(k@0 AS Int64) as rb .k, z@1 as z ]
445+ 04)--ProjectionExec: expr=[k@0 as k, z@1 as z, nullif( CAST(k@0 AS Int64), 1) as nullif(ra .k,Int64(1)) ]
44544605)----DataSourceExec: partitions=1, partition_sizes=[1]
446447
447448statement ok
0 commit comments