-
Notifications
You must be signed in to change notification settings - Fork 1.8k
HashJoin can preserve the right ordering when join type is Right #11276
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
HashJoin can preserve the right ordering when join type is Right #11276
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.
LGTM, thank you.
Edit: After discussing with @mustafasrepo and @berkaysynnada, I think we can add one more small optimization to append_right_indices to leverage existing probe side ordering via merging. We will send another commit to incorporate that in this PR as well
ozankabak
left a 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.
We added the mini optimization and this PR is ready from my perspective. Let's wait a couple days in case anyone wants to check it out and suggest improvements
|
Seems like we have incorporated all the feedback. I will merge this later on today unless we get more feedback for improvements. Thanks everyone |
…che#11276) * Preserve right hash order * Update joins.slt * better sorting alg * remove result * Review * add plan test * Address review feedback * Expand test coverage and update docstring --------- Co-authored-by: Mehmet Ozan Kabak <ozankabak@gmail.com>
…che#11276) * Preserve right hash order * Update joins.slt * better sorting alg * remove result * Review * add plan test * Address review feedback * Expand test coverage and update docstring --------- Co-authored-by: Mehmet Ozan Kabak <ozankabak@gmail.com>
Which issue does this PR close?
Closes #.
Rationale for this change
HashJoins can preserve the order of the right input when the join type is right.
What changes are included in this PR?
HashJoinandNestedLoopJoinusesappend_right_indices()method to combine matched and unmatched right results. This method simply appends the unmatched ones on matched ones. However, if we know that right is ordered, we can merge these indices in order to preserve order.Are these changes tested?
Yes, with an .slt test. Added test would result as:
before, which breaks the order.
Are there any user-facing changes?