vlsi commented on a change in pull request #1756: [CALCITE-1824] GROUP_ID
returns wrong result
URL: https://github.com/apache/calcite/pull/1756#discussion_r366215049
##########
File path:
core/src/main/java/org/apache/calcite/sql/validate/AggregatingSelectScope.java
##########
@@ -110,8 +111,11 @@ private Resolved resolve() {
final Set<ImmutableBitSet> flatGroupSets =
Sets.newTreeSet(ImmutableBitSet.COMPARATOR);
+ final Map<ImmutableBitSet, Integer> groupSetCount = new HashMap<>();
for (List<ImmutableBitSet> groupSet : Linq4j.product(builder.build())) {
- flatGroupSets.add(ImmutableBitSet.union(groupSet));
+ final ImmutableBitSet set = ImmutableBitSet.union(groupSet);
+ groupSetCount.put(set, groupSetCount.getOrDefault(set, 0) + 1);
+ flatGroupSets.add(set);
Review comment:
Is `flatGroupSets` still valid? `groupSetCount` and `flatGroupSets` seem to
duplicate each other.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services