tanmesh commented on code in PR #9263: URL: https://github.com/apache/pinot/pull/9263#discussion_r953079985
########## pinot-clients/pinot-java-client/src/main/java/org/apache/pinot/client/Connection.java: ########## @@ -105,6 +108,29 @@ public ResultSetGroup execute(Request request) return execute(null, request); } + /** + * Extract tableName from the given query + * @param query + * @return tableName + * @throws PinotClientException + */ + public String getTableNameFromQuery(String query) { + PinotQuery pinotQuery; + + try { + pinotQuery = CalciteSqlParser.compileToPinotQuery(query); + } catch (PinotClientException e) { + LOGGER.error("Caught exception while compiling SQL request: {}, {}", query, e.getMessage()); + throw new PinotClientException("Caught exception while compiling SQL request"); + } + + if(pinotQuery.getDataSource() != null) { Review Comment: I have reformat the code with Pinot Style. Please lmk if it looks fine. -- 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