-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[BugFix] Normalize non-trival ProjectNode to eliminate "All slotIds should be remapped" error (backport #42839) #42861
Merged
Conversation
This file contains 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
…hould be remapped" error (#42839) Why I'm doing: When query cache enabled, FE tries to normalize fragments, it recognizes a ProjectNode which only maps SlotId to SlotRefs as trival ProjectNode, but in fact, only when each SlotRef's slotId is equals to its corresponding SlotId, then the ProjectNode is trival. so, FragmentNormalizer should normalize these non-trivial ProjectNodes instead of skipping them. The Fragment snippet as follows: | 6:Decode | | | <dict id 63> : <string id 53> | | | cardinality: 4 | | | column statistics: | | | * field1-->[1.7067168E9, 1.709136E9, 0.0, 8.0, 4.033898305084746] ESTIMATE | | | * field7-->[-Infinity, Infinity, 0.0, 2.8333333333333335, 2.0] ESTIMATE | | | * field9-->[0.2677, 1.9901, 0.05555555555555555, 16.0, 4.033898305084746] ESTIMATE | | | * field15-->[833.37, 6666.96, 0.0, 16.0, 2.0] ESTIMATE | | | * field1-->[1.7067168E9, 1.709136E9, 0.0, 8.0, 4.033898305084746] ESTIMATE | | | * field7-->[-Infinity, Infinity, 0.0, 2.8333333333333335, 2.0] ESTIMATE | | | * field9-->[0.2677, 1.9901, 0.05555555555555555, 16.0, 4.033898305084746] ESTIMATE | | | * field15-->[833.37, 6666.96, 0.0, 16.0, 2.0] ESTIMATE | | | | | 5:Project | | | output columns: | | | 52 <-> [16: field1, DATETIME, true] | | | 54 <-> [24: field9, DECIMAL128(27,4), true] | | | 55 <-> [30: field15, DECIMAL128(27,4), true] | | | 63 <-> [63: field7, INT, true] What I'm doing: FragmentNormalizer normalize non-trival ProjectNode Signed-off-by: satanson <ranpanf@gmail.com> (cherry picked from commit 09e667b)
Quality Gate passedIssues Measures |
satanson
approved these changes
Mar 20, 2024
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.
Why I'm doing:
When query cache enabled, FE tries to normalize fragments, it recognizes a ProjectNode which only maps SlotId to SlotRefs as trival ProjectNode, but in fact, only when each SlotRef's slotId is equals to its corresponding SlotId, then the ProjectNode is trival. so, FragmentNormalizer should normalize these non-trivial ProjectNodes instead of skipping them.
The Fragment snippet as follows:
What I'm doing:
FragmentNormalizer normalize non-trival ProjectNode
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist:
Bugfix cherry-pick branch check:
This is an automatic backport of pull request #42839 done by [Mergify](https://mergify.com). ## Why I'm doing: When query cache enabled, FE tries to normalize fragments, it recognizes a ProjectNode which only maps SlotId to SlotRefs as trival ProjectNode, but in fact, only when each SlotRef's slotId is equals to its corresponding SlotId, then the ProjectNode is trival. so, FragmentNormalizer should normalize these non-trivial ProjectNodes instead of skipping them. The Fragment snippet as follows: ``` | 6:Decode | | | : | | | cardinality: 4 | | | column statistics: | | | * field1-->[1.7067168E9, 1.709136E9, 0.0, 8.0, 4.033898305084746] ESTIMATE | | | * field7-->[-Infinity, Infinity, 0.0, 2.8333333333333335, 2.0] ESTIMATE | | | * field9-->[0.2677, 1.9901, 0.05555555555555555, 16.0, 4.033898305084746] ESTIMATE | | | * field15-->[833.37, 6666.96, 0.0, 16.0, 2.0] ESTIMATE | | | * field1-->[1.7067168E9, 1.709136E9, 0.0, 8.0, 4.033898305084746] ESTIMATE | | | * field7-->[-Infinity, Infinity, 0.0, 2.8333333333333335, 2.0] ESTIMATE | | | * field9-->[0.2677, 1.9901, 0.05555555555555555, 16.0, 4.033898305084746] ESTIMATE | | | * field15-->[833.37, 6666.96, 0.0, 16.0, 2.0] ESTIMATE | | | | | 5:Project | | | output columns: | | | 52 <-> [16: field1, DATETIME, true] | | | 54 <-> [24: field9, DECIMAL128(27,4), true] | | | 55 <-> [30: field15, DECIMAL128(27,4), true] | | | 63 <-> [63: field7, INT, true] ```
What I'm doing:
FragmentNormalizer normalize non-trival ProjectNode
What type of PR is this:
Does this PR entail a change in behavior?
If yes, please specify the type of change:
Checklist: