julianhyde commented on a change in pull request #2458:
URL: https://github.com/apache/calcite/pull/2458#discussion_r675922400



##########
File path: 
core/src/main/java/org/apache/calcite/rel/rel2sql/RelToSqlConverter.java
##########
@@ -504,12 +518,16 @@ protected Builder buildAggregate(Aggregate e, Builder 
builder,
           SqlStdOperatorTable.ROLLUP.createCall(SqlParserPos.ZERO, groupKeys));
     default:
     case OTHER:
+      List<SqlNode> groupingSetsList = aggregate.getGroupSets().stream()
+          .map(groupSet -> groupItem(groupKeys, groupSet, 
aggregate.getGroupSet()))
+          .collect(Collectors.toList());
+      if (ImmutableBitSet.union(aggregate.getGroupSets()).cardinality()
+          != aggregate.getGroupSet().cardinality()) {

Review comment:
       Or, even better, 
`!ImmutableBitSet.union(aggregate.getGroupSets()).equals(aggregate.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