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


##########
pinot-query-planner/src/main/java/org/apache/pinot/query/QueryEnvironment.java:
##########
@@ -208,6 +210,21 @@ public String explainQuery(String sqlQuery) {
     return explainQuery(sqlQuery, 
CalciteSqlParser.compileToSqlNodeAndOptions(sqlQuery)).getExplainPlan();
   }
 
+  @VisibleForTesting
+  public List<String> getTableNamesForQuery(String sqlQuery) {
+    try (PlannerContext plannerContext = new PlannerContext(_config, 
_catalogReader, _typeFactory, _hepProgram)) {
+      RelRoot relRoot = 
compileQuery(CalciteSqlParser.compileToSqlNodeAndOptions(sqlQuery).getSqlNode(),
+          plannerContext);
+      Set<String> tableNames = 
RelToPlanNodeConverter.getTableNamesFromRelRoot(relRoot.rel);
+      return new ArrayList<>(tableNames);
+    } catch (CalciteContextException e) {
+      throw new RuntimeException("Error composing query plan for '" + sqlQuery

Review Comment:
   +1 let's merge the 2 error message



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