comphead commented on code in PR #10304:
URL: https://github.com/apache/datafusion/pull/10304#discussion_r1593140372


##########
datafusion/physical-plan/src/joins/sort_merge_join.rs:
##########
@@ -991,6 +992,9 @@ impl SMJStream {
             Ordering::Equal => {
                 if matches!(self.join_type, JoinType::LeftSemi) {
                     join_streamed = !self.streamed_joined;
+                    // if the join filter specified there can be references to 
buffered columns
+                    // so its needed to join them
+                    join_buffered = self.filter.is_some();

Review Comment:
   I hope the concern right and wrapped it into SQL query
   ```
   query II
   select * from (
   with
   t1 as (
       select 11 a, 12 b union all
       select 11 a, 13 b),
   t2 as (
       select 11 a, 12 b union all
       select 11 a, 12 b union all
       select 11 a, 14 b
       )
   select t1.* from t1 where exists (select 1 from t2 where t2.a = t1.a and 
t2.b != t1.b)
   ) order by 1, 2;
   ----
   11 12
   11 13
   ```
   it passes, I can add it to slt file as well



-- 
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