viirya commented on code in PR #10304:
URL: https://github.com/apache/datafusion/pull/10304#discussion_r1606942756
##########
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;
+ // if the join filter specified there can be references to
buffered columns
+ // so buffered columns are needed to access them
+ join_buffered = join_streamed;
+ }
+ if matches!(self.join_type, JoinType::LeftSemi) &&
self.filter.is_none() {
join_streamed = !self.streamed_joined;
+ // if the join filter specified there can be references to
buffered columns
+ // so buffered columns are needed to access them
+ join_buffered = self.filter.is_some();
Review Comment:
```suggestion
```
--
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]