kasakrisz commented on a change in pull request #1879: [CALCITE-3880] Add 
SortExchange support to RelFieldTrimmer
URL: https://github.com/apache/calcite/pull/1879#discussion_r400306032
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rel/RelDistributions.java
 ##########
 @@ -137,7 +137,7 @@ public RelDistribution apply(Mappings.TargetMapping 
mapping) {
       return getTraitDef().canonize(
           new RelDistributionImpl(type,
               ImmutableIntList.copyOf(
-                  Mappings.apply((Mapping) mapping, keys))));
 
 Review comment:
   `apply` can't handle scenarios when `RelDistribution` in the `SortExchange` 
has less keys than the `Project` under it like:
   ```
   LogicalProject(EMPNO=[$0], ENAME=[$1])
     LogicalSortExchange(distribution=[hash[1]], collation=[[0]])
       LogicalProject(EMPNO=[$0], ENAME=[$1], DEPTNO=[$7])
         LogicalTableScan(table=[[scott, EMP]])
   ```

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


With regards,
Apache Git Services

Reply via email to