You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2020/07/14 02:32:27 UTC

[GitHub] [calcite] chunweilei commented on a change in pull request #2053: [CALCITE-4102] Some improvements to aggregate related operations

chunweilei commented on a change in pull request #2053:
URL: https://github.com/apache/calcite/pull/2053#discussion_r454061401



##########
File path: core/src/main/java/org/apache/calcite/rel/core/Aggregate.java
##########
@@ -548,19 +538,22 @@ public static boolean isRollup(ImmutableBitSet groupSet,
      *
      * @see #isRollup(ImmutableBitSet, List) */
     public static List<Integer> getRollup(List<ImmutableBitSet> groupSets) {
-      final Set<Integer> set = new LinkedHashSet<>();
+      final List<Integer> rollUpBits = new ArrayList<>(groupSets.size() - 1);
       ImmutableBitSet g = null;
       for (ImmutableBitSet bitSet : groupSets) {
         if (g == null) {
           // First item must equal groupSet
         } else {
           // Each subsequent items must be a subset with one fewer bit than the
           // previous item
-          set.addAll(g.except(bitSet).toList());
+          ImmutableBitSet diff = g.except(bitSet);

Review comment:
       Would there be duplicate values since Set is changed to List?




----------------------------------------------------------------
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:
users@infra.apache.org