Skip to content
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: Produce buffered null join row only if all joined rows are failed on join filter in SMJ full join #12090

Merged
merged 8 commits into from
Aug 23, 2024

Conversation

viirya
Copy link
Member

@viirya viirya commented Aug 20, 2024

Which issue does this PR close?

Closes #12091.

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@@ -134,7 +134,6 @@ Alice 100 NULL NULL
Alice 50 Alice 2
Bob 1 NULL NULL
NULL NULL Alice 1
NULL NULL Alice 2
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect. Alice 2 was joined with Alice 50 above. We should not produce null join row for it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double checked the joins, it looks correct

@viirya
Copy link
Member Author

viirya commented Aug 20, 2024

Found this bug during debugging apache/datafusion-comet#553.

@viirya viirya requested review from comphead and alamb August 20, 2024 20:04
query IIII
select * from (
with t as (
select id_a id_a_1, id_a % 5 id_a_2 from (select unnest(make_array(5, 6, 7, 8, 9, 0, 1, 2, 3, 4)) id_a)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order of the values in the array is important. If it is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, it cannot test against the bug.

@github-actions github-actions bot added physical-expr Physical Expressions sqllogictest SQL Logic Tests (.slt) labels Aug 20, 2024
Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm thanks @viirya

@viirya
Copy link
Member Author

viirya commented Aug 21, 2024

Thanks @comphead

@alamb
Copy link
Contributor

alamb commented Aug 21, 2024

FYI @richox

@comphead
Copy link
Contributor

I also checked the SMJ benchmarks are running good on this branch

@viirya
Copy link
Member Author

viirya commented Aug 22, 2024

Thank you @comphead

@viirya viirya merged commit 7806393 into apache:main Aug 23, 2024
24 checks passed
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
physical-expr Physical Expressions sqllogictest SQL Logic Tests (.slt)
Projects
None yet
3 participants