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


##########
datafusion/physical-plan/src/joins/sort_merge_join.rs:
##########
@@ -1161,6 +1164,15 @@ impl SMJStream {
             let filter_columns = if chunk.buffered_batch_idx.is_some() {
                 if matches!(self.join_type, JoinType::Right) {
                     get_filter_column(&self.filter, &buffered_columns, 
&streamed_columns)
+                } else if matches!(self.join_type, JoinType::LeftSemi) {
+                    let buffered_columns = self.buffered_data.batches
+                        [chunk.buffered_batch_idx.unwrap()]
+                    .batch
+                    .columns()
+                    .iter()
+                    .map(|column| take(column, &buffered_indices, None))
+                    .collect::<Result<Vec<_>, ArrowError>>()?;

Review Comment:
   This is a bit duplicate to above one block where preparing 
`buffered_columns`, we can create a small function for it.



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