-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat: Support swap for RightMark Join
#17651
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
Conversation
|
@comphead Decided to circle back to this after forgetting that this was reverted 😆 Are you able to run extended tests? |
|
I think we got something broken, you can still run extended tests on your fork, against your branch |
|
@comphead It is passing on my end. I added the slt test that is the query that caused the error from the previous pull request. |
|
cc @comphead I believe this should be good for another look! |
| .partition_statistics(None) | ||
| .unwrap() | ||
| .total_byte_size, | ||
| Precision::Inexact(2097152) |
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.
can this number be a reason of flaky test in the future?
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 don't think so, i have copied this from the other previous join selection swapping testing and thos ehave been working fine.
comphead
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.
Thanks @jonathanc-n I think the PR is good to go
Co-authored-by: Oleks V <comphead@users.noreply.github.com>
Which issue does this PR close?
Part of fix for #16488
Changes
During decorrelation of an exists subquery into a LeftMark join, the inner side still carries the literal from 'select 1'. The schema looks like this:
right = Projection: [Int64(1), x.b]Projection Pushdown later drops the unused constant and rewrites the right child to just [x.b]. That “drop the first column” step shifts right-side column indices (from b@1 to b@0). During projection mapping it still assumes the old index (often doing “offset by left_width” and not accounting for the mark column), so when it re-indexes into the child it points at the wrong slot (which is what hit the error)
to fix this, I removed the projections when optimizer builds the join
Tests
The test is added to slt.