Decorrelate single-row values#15989
Merged
kasiafi merged 2 commits intotrinodb:masterfrom Feb 7, 2023
Merged
Conversation
516c0a1 to
d262a73
Compare
Before this change, the rule TransformCorrelatedSingleRowSubqueryToProject matched a CorrelatedJoinNode with arbitrary number of ProjectNodes in the subquery. It supported identity projections and at most one non-identity projection. After this change, the rule supports 0 or 1 projection. Projections can be inlined by the rule InlineProjections.
d262a73 to
bc1ce8d
Compare
losipiuk
reviewed
Feb 7, 2023
Member
There was a problem hiding this comment.
nit: should you reflect changes in class javadoc?
Member
Author
There was a problem hiding this comment.
The javadoc was still valid. I added another example with subquery containing no projection.
This change extends rule TransformCorrelatedSingleRowSubqueryToProject so that it supports subqueries being single-row values producing output symbols.
bc1ce8d to
f221608
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this change, the rule
TransformCorrelatedSingleRowSubqueryToProjectmatched a CorrelatedJoinNode with arbitrary number of ProjectNodes in the subquery. It supported identity projections and at most one non-identity projection.After this change, the rule supports 0 or 1 projection. Projections can be inlined by the rule
InlineProjections.This change also extends the rule to handle more kinds of ValuesNode: after the change any single-row values is supported provided that the values row is an expression of type
Row.This change can be also considered a preparatory step before the rule
MergeProjectWithValuesis used more widely. It removes dependency between theMergeProjectWithValuesrule and the de-correlating rules.