arkanovicz commented on code in PR #4115:
URL: https://github.com/apache/calcite/pull/4115#discussion_r1899316591


##########
core/src/main/java/org/apache/calcite/rel/metadata/RelMdUtil.java:
##########
@@ -568,15 +568,15 @@ public static void setAggChildKeys(
       ImmutableBitSet groupKey,
       Aggregate aggRel,
       ImmutableBitSet.Builder childKey) {
-    List<AggregateCall> aggCalls = aggRel.getAggCallList();
+    final List<AggregateCall> aggCallList = aggRel.getAggCallList();
+    final List<Integer> groupList = aggRel.getGroupSet().asList();
     for (int bit : groupKey) {
       if (bit < aggRel.getGroupCount()) {
         // group by column
-        childKey.set(bit);
+        childKey.set(groupList.get(bit));

Review Comment:
   Why is the conversion to list needed? Why not:
   ```
   for (int i: rel.getGroupSet())
   ```
   



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to