HanumathRao commented on a change in pull request #1417: DRILL-6645: Transform TopN in Lateral Unnest pipeline to Sort and Limit. URL: https://github.com/apache/drill/pull/1417#discussion_r207628873
########## File path: exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/TopNPrel.java ########## @@ -115,6 +118,16 @@ public Prel addImplicitRowIDCol(List<RelNode> children) { .replace(this.getTraitSet().getTrait(DrillDistributionTraitDef.INSTANCE)) .replace(collationTrait) .replace(DRILL_PHYSICAL); - return (Prel) this.copy(traits, children); + return transformTopNToSortAndLimit(children, traits, collationTrait); + } + + private Prel transformTopNToSortAndLimit(List<RelNode> children, RelTraitSet traits, RelCollation collationTrait) { Review comment: SelectionVector are created at the later stage. This is called before inserting the selectionvector. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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