rubenada commented on code in PR #4115:
URL: https://github.com/apache/calcite/pull/4115#discussion_r1903856645
##########
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));
} else {
Review Comment:
`aggRel.getGroupSet().get(i)` would return a boolean, what we need here is
an index conversion. I'm basically following the same logic as the one already
applied on [RelMdColumnOrigins for
aggregates](https://github.com/apache/calcite/blob/901aadbe8bd55e2da791d9d827185a8c803b1b76/core/src/main/java/org/apache/calcite/rel/metadata/RelMdColumnOrigins.java#L74).
--
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]