nielspardon commented on code in PR #3703: URL: https://github.com/apache/calcite/pull/3703#discussion_r1502347632
########## core/src/main/java/org/apache/calcite/tools/RelBuilder.java: ########## @@ -2510,7 +2510,7 @@ private RelBuilder aggregate_(GroupKeyImpl groupKey, // duplicates, then add a Project. final Set<AggregateCall> callSet = new HashSet<>(); final PairList<Integer, @Nullable String> projects = PairList.of(); - Util.range(groupSet.cardinality()) + Util.range(groupSet2.cardinality()) Review Comment: - I renamed `groupSet2` and `groupSets2` to `groupSetAfterPruning` and `groupSetsAfterPruning` respectively to give them more obvious names. - I also renamed the helper variable `map` to `sourceFieldToTargetFieldMap` to make it more obvious. - I moved the field pruning and agg call deduplication code into its own `pruneAggregateInputFieldsAndDeduplicateAggCalls ` method to reduce the length of the original `aggregate_()` method. -- 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. To unsubscribe, e-mail: commits-unsubscr...@calcite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org