[CALCITE-4239] RelMdUniqueKeys returns wrong unique keys for Aggregate with grouping sets - #2145
Merged
Merged
Conversation
chunweilei
force-pushed
the
CALCITE-4239
branch
from
September 10, 2020 03:25
f813687 to
fbd2ed0
Compare
liyafan82
reviewed
Sep 10, 2020
| ImmutableBitSet groupKey = ImmutableBitSet.range(rel.getGroupCount()); | ||
| return columns.contains(groupKey); | ||
| } | ||
| return false; |
Contributor
There was a problem hiding this comment.
should we return false or null?
Contributor
Author
There was a problem hiding this comment.
Return null seems better(it means unknown). Thank you for your review.
liyafan82
reviewed
Sep 10, 2020
| return ImmutableSet.of(rel.getGroupSet()); | ||
| if (Aggregate.isSimple(rel) || ignoreNulls) { | ||
| // group by keys form a unique key | ||
| return ImmutableSet.of(rel.getGroupSet()); |
Contributor
There was a problem hiding this comment.
Since the group set is immutable, we can directly return rel.getGroupSet()?
Contributor
Author
There was a problem hiding this comment.
I don't think so. rel.getGroupSet() returns ImmutableBitSet while here we should return Set<ImmutableBitSet>
Contributor
There was a problem hiding this comment.
I see. Thanks for the clarification.
liyafan82
approved these changes
Sep 11, 2020
liyafan82
left a comment
Contributor
There was a problem hiding this comment.
Thank you for fixing the problem.
…e with grouping sets
chunweilei
force-pushed
the
CALCITE-4239
branch
from
September 14, 2020 02:07
0096b7f to
41c6ca1
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.
No description provided.