walterddr commented on code in PR #10336:
URL: https://github.com/apache/pinot/pull/10336#discussion_r1119332970


##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotQueryResource.java:
##########
@@ -170,10 +171,10 @@ private String getMultiStageQueryResponse(String query, 
String queryOptions, Htt
       return QueryException.ACCESS_DENIED_ERROR.toString();
     }
 
-    // Get brokers, only DEFAULT tenant is supported for now.
-    // TODO: implement logic that only allows executing query where all 
accessed tables are within the same tenant.
-    List<String> instanceIds = new 
ArrayList<>(_pinotHelixResourceManager.getAllInstancesForBrokerTenant(
-        TagNameUtils.DEFAULT_TENANT_NAME));
+    SqlNodeAndOptions sqlNodeAndOptions = RequestUtils.parseQuery(query);
+    List<String> tableNames = 
CalciteSqlParser.extractTableNamesFromNode(sqlNodeAndOptions.getSqlNode());
+
+    List<String> instanceIds = getCommonInstances(tableNames);

Review Comment:
   this change will probably be useless as 
   1. the actual broker API only supports default tenant (hard-coded in many 
places)
   2. can only get routing table for its responsible set of tables, but it is 
responsible for generating stage plans for the entire query.
   
   Thus my suggestion is should we let's limit the scope to "all tables belong 
to the same tenant, not necessarily 'default'" first?
   and try to get it E2E right before we support random tenant combinations?



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