comphead commented on code in PR #10304:
URL: https://github.com/apache/datafusion/pull/10304#discussion_r1599255387
##########
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'm not able to run such test just because of other SMJ issue not related to
this PR:
If the join filter is set and for the same streaming index there are
matching rows more or equal to a batch size then the query just stuck. Likely
the problem is in polling state and it can be easily reproduced on main branch.
```
#[tokio::test]
async fn test_11() -> Result<()> {
let ctx: SessionContext = SessionContext::new();
let sql = "set datafusion.optimizer.prefer_hash_join = false;";
let _ = ctx.sql(sql).await?.collect().await?;
let sql = "set datafusion.execution.batch_size = 1";
let _ = ctx.sql(sql).await?.collect().await?;
let sql = "
select * from (
with
t1 as (
select 12 a, 12 b
),
t2 as (
select 12 a, 12 b
)
select t1.* from t1 join t2 on t1.a = t2.b where t1.a > t2.b
) order by 1, 2;
";
let actual = ctx.sql(sql).await?.collect().await?;
Ok(())
}
```
I'll file a separate issue for this one, but perhaps we can go with this PR
because potential problem you talking about cannot ever be hit because of the
issue above
--
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]