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


##########
datafusion/physical-plan/src/joins/sort_merge_join.rs:
##########
@@ -989,8 +996,21 @@ impl SMJStream {
                 }
             }
             Ordering::Equal => {
-                if matches!(self.join_type, JoinType::LeftSemi) {
+                if matches!(self.join_type, JoinType::LeftSemi) && 
self.filter.is_some() {
+                    join_streamed = !self
+                        .streamed_batch
+                        .join_filter_matched_idxs
+                        .contains(&(self.streamed_batch.idx as u64))
+                        && !self.streamed_joined;

Review Comment:
   If `self.streamed_joined` is false, `join_filter_matched_idxs` always 
doesn't contain `self.streamed_batch.idx`, so the two conditions are duplicated 
as they are both true.
   
   If `self.streamed_joined` is true, this `and` check is failed, the another 
condition doesn't matter.
   
   I'm not sure what this is added to check.
   



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