-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix SortMergeJoin with join filter filtering all rows out #10495
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @viirya -- looks good to me
datafusion/core/tests/sql/joins.rs
Outdated
let sql = "set datafusion.execution.batch_size = 1"; | ||
let _ = ctx.sql(sql).await?.collect().await?; | ||
|
||
let sql = " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any reason this isn't a slt test (in https://github.com/apache/datafusion/blob/main/datafusion/sqllogictest/test_files/sort_merge_join.slt)? Looks like it would work just fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I simply copy the reproducer from the issue. Let me move it to sort_merge_join.slt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thanks @viirya for quick turnaround,I agree lets please move the test to slt file
@@ -1323,7 +1323,9 @@ impl SMJStream { | |||
// If join filter exists, `self.output_size` is not accurate as we don't know the exact | |||
// number of rows in the output record batch. If streamed row joined with buffered rows, | |||
// once join filter is applied, the number of output rows may be more than 1. | |||
if record_batch.num_rows() > self.output_size { | |||
// If `record_batch` is empty, we should reset `self.output_size` to 0. It could be happened |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
* Fix SortMergeJoin with join filter filtering all rows out * Move test * Update datafusion/sqllogictest/test_files/sort_merge_join.slt --------- Co-authored-by: Oleks V <[email protected]>
Which issue does this PR close?
Closes #10491.
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?