aadilkhalifa commented on code in PR #12537:
URL: https://github.com/apache/pinot/pull/12537#discussion_r1510984829


##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotQueryResource.java:
##########
@@ -243,10 +246,17 @@ private String getQueryResponse(String query, @Nullable 
SqlNode sqlNode, String
     // Get resource table name.
     String tableName;
     try {
-      String inputTableName =
-          sqlNode != null ? 
RequestUtils.getTableNames(CalciteSqlParser.compileSqlNodeToPinotQuery(sqlNode)).iterator()
-              .next() : 
CalciteSqlCompiler.compileToBrokerRequest(query).getQuerySource().getTableName();
-      tableName = 
_pinotHelixResourceManager.getActualTableName(inputTableName);
+      if (sqlNode != null) {
+        PinotQuery pinotQuery = 
CalciteSqlParser.compileSqlNodeToPinotQuery(sqlNode);
+        if (pinotQuery.isShowTables()) {
+          return showTablesResponse();
+        }
+        String inputTableName = 
RequestUtils.getTableNames(pinotQuery).iterator().next();
+        tableName = 
_pinotHelixResourceManager.getActualTableName(inputTableName);

Review Comment:
   @xiangfu0 I've moved code to broker now. Can you have a look?



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