rubenada commented on a change in pull request #1918:
URL: https://github.com/apache/calcite/pull/1918#discussion_r417905918



##########
File path: core/src/main/java/org/apache/calcite/rel/rules/PruneEmptyRules.java
##########
@@ -277,7 +278,11 @@ private static boolean isEmpty(RelNode node) {
           if (sort.fetch != null
               && !(sort.fetch instanceof RexDynamicParam)
               && RexLiteral.intValue(sort.fetch) == 0) {
-            call.transformTo(call.builder().push(sort).empty().build());
+            RelNode emptyValues = call.builder().push(sort).empty().build();
+            emptyValues = emptyValues.copy(
+                emptyValues.getTraitSet().replace(sort.getCollation()),
+                Collections.emptyList());

Review comment:
       Thanks @danny0405 , I have added a comment in there.




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