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


##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotQueryResource.java:
##########
@@ -269,10 +271,22 @@ private String getQueryResponse(String query, @Nullable 
SqlNode sqlNode, String
       return 
QueryException.getException(QueryException.QUERY_VALIDATION_ERROR, 
e).toString();
     }
     try {
-      String inputTableName =
-          sqlNode != null ? 
RequestUtils.getTableNames(CalciteSqlParser.compileSqlNodeToPinotQuery(sqlNode)).iterator()
-              .next() : 
CalciteSqlCompiler.compileToBrokerRequest(query).getQuerySource().getTableName();
-      tableName = 
_pinotHelixResourceManager.getActualTableName(inputTableName, database);
+      List<String> inputTableNames = new ArrayList<>();
+      if (sqlNode != null) {
+        if (sqlNode instanceof SqlShowTables) {
+          
inputTableNames.addAll(_pinotHelixResourceManager.getAllTables(database));

Review Comment:
   I've made this change. Can you please have a look?



##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotQueryResource.java:
##########
@@ -269,10 +271,22 @@ private String getQueryResponse(String query, @Nullable 
SqlNode sqlNode, String
       return 
QueryException.getException(QueryException.QUERY_VALIDATION_ERROR, 
e).toString();
     }
     try {
-      String inputTableName =
-          sqlNode != null ? 
RequestUtils.getTableNames(CalciteSqlParser.compileSqlNodeToPinotQuery(sqlNode)).iterator()
-              .next() : 
CalciteSqlCompiler.compileToBrokerRequest(query).getQuerySource().getTableName();
-      tableName = 
_pinotHelixResourceManager.getActualTableName(inputTableName, database);
+      List<String> inputTableNames = new ArrayList<>();
+      if (sqlNode != null) {
+        if (sqlNode instanceof SqlShowTables) {
+          
inputTableNames.addAll(_pinotHelixResourceManager.getAllTables(database));
+        } else if (sqlNode instanceof SqlDescribeTable) {
+          inputTableNames.add(((SqlDescribeTable) 
sqlNode).getTable().toString());

Review Comment:
   I've made this change.



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