SubhamSinghal commented on code in PR #25467:
URL: https://github.com/apache/datafusion/pull/25467#discussion_r4052518760


##########
datafusion/sqllogictest/test_files/pwmj.slt:
##########
@@ -1236,6 +1466,130 @@ physical_plan
 05)--------DataSourceExec: partitions=1, partition_sizes=[1]
 06)------DataSourceExec: partitions=1, partition_sizes=[1]
 
+# `LeftMark` shares the exact same buffered-side comparator 
(`JoinKeyComparator`, sorted by
+# `required_input_ordering`) as `LeftSemi`/`LeftAnti` above -- only 
`emit_matched`'s final step
+# differs (slice vs. `mark` column) -- so this pins that a dictionary key 
marks correctly
+# through that shared path too. `>` : only 'e' (id 3) is above 'c', same 
outcome the `EXISTS`
+# query above already pinned for `LeftSemi`.
+query I
+SELECT l.id FROM ex_dict_l l
+WHERE l.id > 100 OR EXISTS (SELECT 1 FROM ex_dict_r r WHERE l.v > r.v) ORDER 
BY 1;
+----
+3
+
+# ------------------------------------------------------------------
+# Existence joins: LeftMark with List/LargeList/FixedSizeList keys
+# ------------------------------------------------------------------
+
+statement ok
+CREATE TABLE ex_list_l(id INT, v INT[]);
+
+statement ok
+INSERT INTO ex_list_l VALUES (1, [1]), (2, [2]), (3, [4]), (4, [5]);
+
+statement ok
+CREATE TABLE ex_list_r(v INT[]);
+
+statement ok
+INSERT INTO ex_list_r VALUES ([2]), ([4]);
+
+# `>` : `EXISTS r WHERE l.v > r.v` holds iff `l.v` beats the smallest `r.v` 
([2]), which only
+# [4] (id 3) and [5] (id 4) do.
+query I
+SELECT l.id FROM ex_list_l l
+WHERE l.id > 100 OR EXISTS (SELECT 1 FROM ex_list_r r WHERE l.v > r.v) ORDER 
BY 1;
+----
+3
+4
+
+# `LargeList`/`FixedSizeList` go through the same generic comparator as `List` 
above

Review Comment:
   Addressed in 8885ca1914c081f0f5c97984d7248fcf5c18cd7d



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to