Jackie-Jiang commented on a change in pull request #7568:
URL: https://github.com/apache/pinot/pull/7568#discussion_r755656841



##########
File path: 
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
##########
@@ -519,6 +543,18 @@ private BrokerResponseNative handleSQLRequest(long 
requestId, String query, Json
     return brokerResponse;
   }
 
+  /** Set EXPLAIN PLAN query to route to only one server. */
+  private void setRoutingToOneServer(Map<ServerInstance, List<String>> 
routingTable) {
+    Set<Map.Entry<ServerInstance, List<String>>> servers = 
routingTable.entrySet();
+    // only send request to 1 server
+    Map.Entry<ServerInstance, List<String>> server = servers.iterator().next();
+    routingTable.clear();
+    List<String> segments = new ArrayList<>();
+    // only generate the plan for 1 segment
+    segments.add(server.getValue().get(0));
+    routingTable.put(server.getKey(), segments);

Review comment:
       (minor) No need to create an extra list
   ```suggestion
       routingTable.put(entry.getKey(), entry.getValue());
   ```




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