albertobastos commented on code in PR #14806:
URL: https://github.com/apache/pinot/pull/14806#discussion_r1919020149


##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java:
##########
@@ -199,8 +201,15 @@ protected BrokerResponse handleRequest(long requestId, 
String query, SqlNodeAndO
     }
 
     DispatchableSubPlan dispatchableSubPlan = queryPlanResult.getQueryPlan();
-    Set<String> tableNames = queryPlanResult.getTableNames();
 
+    Set<QueryServerInstance> servers = 
dispatchableSubPlan.getQueryStageList().stream()
+        .map(DispatchablePlanFragment::getServerInstances)
+        .reduce(new HashSet<QueryServerInstance>(), (all, some) -> {
+          all.addAll(some);
+          return all;
+        });

Review Comment:
   I'm gonna betray Gonzalo here 😇
   
   I'm more into using a conventional loop with addAll, too. Using streams here 
feels a bit overkill for what the code intends to do. Going through the whole 
array anyway, so I don't see the point of relying into streams.
   
   Actually, that was my first draft and changed it afterwards trying to show 
off. It obviously didn't go as intended, so conventional loop it is: 
[de63ddeead](https://github.com/apache/pinot/pull/14806/commits/de63ddeeadbebdfe88910179140046bab66bfcf2)



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