-
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: Skip buffered rows which are not joined with streamed side when checking join filter results #12159
Conversation
…checking join filter results
// If the buffered row is not joined with streamed side, | ||
// skip it. | ||
if buffered_indices.is_null(i) { | ||
continue; | ||
} | ||
|
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.
I was trying to duplicate the Spark SQL test but the test failure depends on the data distribution. I cannot make it as same as Spark case.
The test case looks like
select * from (
with left as (
select N, L from (select unnest(make_array(1, 2, 3, 4)) N, unnest(make_array('A', 'B', 'C', 'D')) L) where N <= 4
), right as (
select N, L from (select unnest(make_array(1, 2, 3, 4)) N, unnest(make_array('A', 'B', 'C', 'D')) L) where N >= 3
)
select * from left full join right on left.N = right.N and left.N != 3
) order by 1, 2, 3, 4;
I want those values to be in same partition to run sort merge join. So the joined batch looks like:
1 A null null
2 B null null # this and above row wrongly considered passing join filter for buffered row [3, C]
3 C 3 C # join filter => false
4 D 4 D # join filter => true
The buffered row [3, C] fails join filter. So it should be output as null joined buffered row, but the two above rows are wrongly considered passing join filter for buffered index 0
(i.e., [3, C]), it will not be output in Comet.
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.
The test case in Comet is apache/datafusion-comet#553 (comment)
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 @viirya I feel for this test would be nice to have a DataFusion test, but you said it depends on data distribution between record batches
Thanks @comphead |
Let me merge this to unblock apache/datafusion-comet#553. |
Which issue does this PR close?
Closes #.
Rationale for this change
Found a test failure on Spark SQL test suite in apache/datafusion-comet#553 (https://github.com/apache/datafusion-comet/actions/runs/10498306015/job/29082983619?pr=553).
When checking join filter results for buffered rows, we should exclude those rows which are not joined with streamed side (i.e., null slots in
buffered_indices
). Otherwise, we may wrongly consider those rows passing join filter results and lack of null joined buffered rows as in the test.What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?