You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "walterddr (via GitHub)" <gi...@apache.org> on 2023/02/27 21:31:06 UTC

[GitHub] [pinot] walterddr commented on a diff in pull request #10336: [Multistage] Allow queries on multiple tables of same tenant to be executed from controller UI

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 plan 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 right before we support random tenant combination?



-- 
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-unsubscribe@pinot.apache.org

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


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