rubenada commented on a change in pull request #1918:
URL: https://github.com/apache/calcite/pull/1918#discussion_r411194916
##########
File path: core/src/main/java/org/apache/calcite/rel/rules/PruneEmptyRules.java
##########
@@ -400,7 +401,13 @@ private static boolean isEmpty(RelNode node) {
public void onMatch(RelOptRuleCall call) {
SingleRel single = call.rel(0);
- call.transformTo(call.builder().push(single).empty().build());
+ RelNode emptyValues = call.builder().push(single).empty().build();
+ if (single instanceof Sort) {
+ emptyValues = emptyValues.copy(
+ emptyValues.getTraitSet().replace(((Sort) single).getCollation()),
+ Collections.emptyList());
+ }
Review comment:
Unfortunately, I cannot find a clean way of tweaking EmptyValues'
collation to satisfy any collation. Since propagating all traits into
EmptyValues did not work either, I am going back to the original solution of
propagating just collation into EmptyValues if we are removing a Sort from the
plan.
----------------------------------------------------------------
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]