xy2953396112 commented on a change in pull request #2546:
URL: https://github.com/apache/calcite/pull/2546#discussion_r737969304



##########
File path: 
core/src/main/java/org/apache/calcite/rel/rules/AggregateProjectMergeRule.java
##########
@@ -125,14 +125,17 @@ public AggregateProjectMergeRule(
             newGroupSet, newGroupingSets, aggCalls.build());
 
     // Add a project if the group set is not in the same order or
-    // contains duplicates.
+    // contains duplicates or contains alias.
     final RelBuilder relBuilder = call.builder();
     relBuilder.push(newAggregate);
     final List<Integer> newKeys =
         Util.transform(aggregate.getGroupSet().asList(),
             key -> requireNonNull(map.get(key),
                 () -> "no value found for key " + key + " in " + map));
-    if (!newKeys.equals(newGroupSet.asList())) {
+    final List<String> newaggFieldNames = 
newAggregate.getRowType().getFieldNames();
+    final List<String> aggFieldNames = aggregate.getRowType().getFieldNames();

Review comment:
       > newaggFieldNames -> newAggFieldNames?
   
   ok, thanks.




-- 
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


Reply via email to