amaliujia commented on a change in pull request #2423:
URL: https://github.com/apache/calcite/pull/2423#discussion_r646821065



##########
File path: core/src/main/java/org/apache/calcite/sql2rel/SqlToRelConverter.java
##########
@@ -5758,14 +5758,21 @@ private void translateAgg(SqlCall call, @Nullable 
SqlNode filter,
       if (orderList == null || orderList.size() == 0) {
         collation = RelCollations.EMPTY;
       } else {
-        collation = RelCollations.of(
-            orderList.stream()
-                .map(order ->
-                    bb.convertSortExpression(order,
-                        RelFieldCollation.Direction.ASCENDING,
-                        RelFieldCollation.NullDirection.UNSPECIFIED,
-                        this::sortToFieldCollation))
-                .collect(Collectors.toList()));
+        try {
+          // switch out of agg mode
+          bb.agg = null;

Review comment:
       My question is why not keep the reference of bb.agg and then in the 
finally block, assign that reference back? (or is the bb.agg is always equal to 
this class?)




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

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


Reply via email to