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_r207583353
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/Prel.java
 ##########
 @@ -56,7 +56,13 @@ public boolean 
useAbstractConvertersForConversion(RelTraitSet fromTraits,
   SelectionVectorMode getEncoding();
   boolean needsFinalColumnReordering();
 
-  default Prel addImplicitRowIDCol(List<RelNode> children) {
+  /**
+   * If the operator is in Lateral/Unnest pipeline, then it generates a new 
operator which knows how to process
+   * the rows accordingly during execution.
+   * eg: TopNPrel -> SortPrel and LimitPrel
+   * Other operators like FilterPrel, ProjectPrel etc will add an implicit row 
id to the output.
+   */
+  default Prel getRelForLateralUnnestPipeline(List<RelNode> children) {
     throw new UnsupportedOperationException("Adding Implicit RowID column is 
not supported for " +
 
 Review comment:
   This function name is changed from `addImplicitRowIdCol` to 
`getRelForLateralUnnestPipeline` but from comments it looks like it does both 
the functionality. Based on my understanding for all operators except 
`TopNPrel` it's actually adding the `implicitRowIdCol` information, but since 
topN will not be supported inside subquery and needs to be replaced by 
PartitionLimit + Sort we are transforming it inside this function. And the new 
limit and Sort will have the information about the implicitRowIdCol. If this is 
true, then we should keep the name same as before and in TopN as you have done 
calling separate private function `transformTopNToSortAndLimit` is fine.

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