-
-
Notifications
You must be signed in to change notification settings - Fork 210
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 for commutative join types getting stuck in analysis loop #1411
Conversation
… why HashLookup/CachedResults nodes are missing
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 am concerned that the correctness of this relies on a pre-existing bug (my mistake). We will fix that bug at some point, and the cycling will kick in again. Details below.
…sions in expression groups.
…each subquery and runs from the bottom of the tree up.
@max-hoffman – this one is ready for another look now that the |
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! I will follow up with the hasJoinRelExpr
simplification next week
return finalizeSubqueriesHelper(ctx, a, n, scope, sel) | ||
} | ||
|
||
// finalizeSubqueriesHelper recurses through the specified |node| to find all leaf subqueries and subquery expressions, |
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.
one confusing thing is that the traversal connectivity crosses some scope boundaries, but not others. I think it still works? for example subqueries in unions, windows, or insert sources.
This change fixes an issue where the analyzer can get stuck in a loop bouncing back and forth between the original and commuted plan and being unable to stabilize the plan.
As part of that fix... it also deduplicates logically identical
relExpr
s inexprGroup
s and changes thefinalizeSubqueries
analyzer rule so that it only runs once on each subquery, from the bottom of the plan tree, up.Fixes: dolthub/dolt#4816
Dolt Tests: dolthub/dolt#4859