Jackie-Jiang commented on code in PR #11332:
URL: https://github.com/apache/pinot/pull/11332#discussion_r1292883385
##########
pinot-query-planner/src/main/java/org/apache/pinot/query/QueryEnvironment.java:
##########
@@ -238,6 +240,11 @@ public List<String> getTableNamesForQuery(String sqlQuery)
{
Set<String> tableNames =
RelToPlanNodeConverter.getTableNamesFromRelRoot(relRoot.rel);
return new ArrayList<>(tableNames);
} catch (Throwable t) {
Review Comment:
Not introduced in this PR, but we should not catch all `Throwable` here
##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java:
##########
@@ -152,10 +152,12 @@ protected BrokerResponse handleRequest(long requestId,
String query, @Nullable S
break;
}
} catch (Exception e) {
- LOGGER.info("Caught exception while compiling SQL request {}: {}, {}",
requestId, query, e.getMessage());
+ LOGGER.info("Caught exception while compiling SQL request {}: {}, {}",
requestId, query,
Review Comment:
How do we ensure the exception caught is compilation exception? Currently if
it throws no access exception, this will cause NPE.
We probably need to explicitly check for exception type
##########
pinot-query-planner/src/main/java/org/apache/pinot/query/QueryEnvironment.java:
##########
@@ -238,6 +240,11 @@ public List<String> getTableNamesForQuery(String sqlQuery)
{
Set<String> tableNames =
RelToPlanNodeConverter.getTableNamesFromRelRoot(relRoot.rel);
return new ArrayList<>(tableNames);
} catch (Throwable t) {
+ String errorMessage = t.getMessage();
+ if (errorMessage.contains("Could not find schema for table: ")) {
Review Comment:
This is not robust. We should not rely on message content.
I saw this exception is thrown from `PinotCatalog`, and `getTable()` should
return `null` when it cannot be found based on the interface javadoc
--
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]