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

 ##########
 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:
   the transform is just replacing `TopNPrel` with new `SortPrel` and 
`PartitionLimitPrel`. My understanding is at this stage all the 
`SelectionVectorRemoverPrel` is also created wherever needed. In this case also 
between `SortPrel` and `LimitPrel` we have to insert a 
`SelectionVectorRemoverPrel` since `Limit` can only accept `SV2/SV None` 
whereas `Sort` can produce `SV None and SV4`

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to