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



##########
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:
       Thanks for clarifying. 
   
   I can see now this is already an existing practice.




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