Skip to content

Commit fa12ec3

Browse files
viiryaIsaac
andcommitted
test: update correlated NOT IN plan in subquery_projection.slt
Co-authored-by: Isaac <[email protected]>
1 parent 3d586a3 commit fa12ec3

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎datafusion/sqllogictest/test_files/subquery_projection.slt‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,9 @@ statement ok
403403
DROP 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.
410411
statement ok
@@ -438,10 +439,10 @@ logical_plan
438439
05)------Projection: CAST(rb.k AS Int64), rb.z
439440
06)--------TableScan: rb projection=[k, z]
440441
physical_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]
443444
03)----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))]
445446
05)----DataSourceExec: partitions=1, partition_sizes=[1]
446447

447448
statement ok

0 commit comments

Comments
 (0)