opt: don't use outer columns as implicit grouping columns#68678
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom Aug 17, 2021
Merged
opt: don't use outer columns as implicit grouping columns#68678craig[bot] merged 1 commit intocockroachdb:masterfrom
craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
Previously, the optbuilder logic would add any outer column that is referenced in a grouping context to the set of grouping columns. This is correct in some cases, because outer columns are effectively constant, and can just be removed by norm rules. However, it is incorrect in the case when there are no grouping columns, e.g. a `ScalarGroupBy`. In that case, the `ScalarGroupBy` would inadvertently be converted into a `GroupBy`. This patch modifies the optbuilder to simply ignore outer columns in a grouping context. Fixes cockroachdb#68290 Release note: None
Member
mgartner
approved these changes
Aug 11, 2021
Contributor
mgartner
left a comment
There was a problem hiding this comment.
You might want to wait for Radu to take a look though - I'm not super familiar with this part of the code.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @RaduBerinde)
Collaborator
Author
|
@RaduBerinde mind taking look when you have time? |
RaduBerinde
approved these changes
Aug 17, 2021
Member
RaduBerinde
left a comment
There was a problem hiding this comment.
Sorry for the delay, I was out until last night.
Reviewable status:
complete! 2 of 0 LGTMs obtained (waiting on @DrewKimball)
Collaborator
Author
|
No worries! This is pretty low-priority |
Collaborator
Author
|
TFTRs! |
Collaborator
Author
|
bors r+ |
Contributor
|
Build succeeded: |
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.
Previously, the optbuilder logic would add any outer column that is
referenced in a grouping context to the set of grouping columns. This
is correct in some cases, because outer columns are effectively constant,
and can just be removed by norm rules. However, it is incorrect in the
case when there are no grouping columns, e.g. a
ScalarGroupBy. In thatcase, the
ScalarGroupBywould inadvertently be converted into aGroupBy.This patch modifies the optbuilder to simply ignore outer columns in a
grouping context.
Fixes #68290
Release note: None