-
Notifications
You must be signed in to change notification settings - Fork 25
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
Subquery Unnesting Agg NULL case workarounds #257
Conversation
jurplel
commented
Dec 7, 2024
- Add an outer join with the deduplicated "left side", and a corresponding projection node, to pass along NULL values as expected.
- Add a specific workaround in the projection node to case NULL -> 0 if we have a COUNT(*).
new_outer_join.into_plan_node(), | ||
ListPred::new( | ||
(0..left_schema_size) | ||
.chain(left_schema_size + left_schema_size..left_schema_size + new_agg_schema_size) |
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.
This is one thing I am not sure of the correctness of.
The meaning is to take:
- Everything from the left side
- Everything from the right side that is not in the left side.
I found this to be correct in all the tests that I wrote.
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.
Everything from the right side that is not in the left side.
Maybe we need to figure out the exact meaning of this -- do you want to know if two columns refer to the same table-column?
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.
Okay, so after thinking about it a bit longer, my description is correct, but it is a bit easier to think about than that:
The right side is going to be the subquery on the right, and the deduplicated part on the left.
The left side is going to be a copy of the deduplicated part that is the left child of the right child.
So, our projection will be the deduplicated copy (that will be outer joined to resolve the null problems) and the non-deduplicated part from the right side.
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.
...anyways, let's get thing through as long as they fix things, even if it's not 100% fix, and visit them back later