jcamachor commented on a change in pull request #557: HIVE-21338 Remove order by and limit for aggregates URL: https://github.com/apache/hive/pull/557#discussion_r263210480
########## File path: ql/src/java/org/apache/hadoop/hive/ql/parse/CalcitePlanner.java ########## @@ -1925,6 +1926,11 @@ public RelNode apply(RelOptCluster cluster, RelOptSchema relOptSchema, SchemaPlu perfLogger.PerfLogEnd(this.getClass().getName(), PerfLogger.OPTIMIZER, "Calcite: Window fixing rule"); } + perfLogger.PerfLogBegin(this.getClass().getName(), PerfLogger.OPTIMIZER); Review comment: I believe now that the rule relies on the logic from the metadata provider that is more powerful, we could move this before step 6. in ```applyPreJoinOrderingTransforms```. This means that ```RelFieldTrimmer``` will be executed after this rule and thus may eliminate any column(s) that were used by SortLimit but are not needed anymore (for instance, the example above). ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services