kgyrtkirk commented on code in PR #17038:
URL: https://github.com/apache/druid/pull/17038#discussion_r1803050697


##########
extensions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/WindowOperatorQueryKit.java:
##########
@@ -377,4 +316,37 @@ private static RowSignature 
computeSignatureForFinalWindowStage(RowSignature row
         finalWindowClusterBy.getColumns()
     );
   }
+
+  /**
+   * This method converts the operator chain received from native plan into 
MSQ plan.
+   * (NaiveSortOperator -> Naive/GlueingPartitioningOperator -> 
WindowOperator) is converted into (GlueingPartitioningOperator -> 
PartitionSortOperator -> WindowOperator).
+   * We rely on MSQ's shuffling to do the clustering on partitioning keys for 
us at every stage.
+   * This conversion allows us to blindly read N rows from input channel and 
push them into the operator chain, and repeat until the input channel isn't 
finished.
+   * @param operatorFactoryListFromQuery
+   * @param maxRowsMaterializedInWindow
+   * @return
+   */
+  private List<OperatorFactory> 
getOperatorFactoryListForStageDefinition(List<OperatorFactory> 
operatorFactoryListFromQuery, int maxRowsMaterializedInWindow)
+  {
+    final List<OperatorFactory> operatorFactoryList = new ArrayList<>();
+    final List<OperatorFactory> sortOperatorFactoryList = new ArrayList<>();

Review Comment:
   we will improve on this later - for now this removes the need to fully sort 
all rows



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to