Jackie-Jiang commented on code in PR #11234:
URL: https://github.com/apache/pinot/pull/11234#discussion_r1281482735


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/routing/WorkerManager.java:
##########
@@ -96,19 +97,66 @@ private static boolean isLeafPlan(DispatchablePlanMetadata 
metadata) {
   }
 
   private void assignWorkersToLeafFragment(PlanFragment fragment, 
DispatchablePlanContext context) {
-    DispatchablePlanMetadata metadata = 
context.getDispatchablePlanMetadataMap().get(fragment.getFragmentId());
-    // table scan stage, need to attach server as well as segment info for 
each physical table type.
-    List<String> scannedTables = metadata.getScannedTables();
-    String logicalTableName = scannedTables.get(0);
-    Map<String, RoutingTable> routingTableMap = 
getRoutingTable(logicalTableName, context.getRequestId());
-    if (routingTableMap.size() == 0) {
-      throw new IllegalArgumentException("Unable to find routing entries for 
table: " + logicalTableName);
+    // NOTE: For pipeline breaker, leaf fragment can also have children
+    for (PlanFragment child : fragment.getChildren()) {
+      assignWorkersToNonRootFragment(child, context);
+    }
+
+    TableScanNode tableScanNode = 
findTableScanNode(fragment.getFragmentRoot());
+    Preconditions.checkState(tableScanNode != null, "Failed to find table scan 
node under leaf fragment");
+    String tableName = tableScanNode.getTableName();
+
+    // Extract partitionKey and numPartitions from hint if provided
+    Map<String, String> tableHintOptions =
+        
tableScanNode.getNodeHint()._hintOptions.get(PinotHintOptions.TABLE_HINT_OPTIONS);

Review Comment:
   Moved to `DispatchablePlanVisitor`



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to