You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/05/03 19:32:41 UTC

[GitHub] [incubator-pinot] Jackie-Jiang commented on a change in pull request #6765: Fix the exception thrown when the table is not found

Jackie-Jiang commented on a change in pull request #6765:
URL: https://github.com/apache/incubator-pinot/pull/6765#discussion_r625316486



##########
File path: pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/BaseBrokerRequestHandler.java
##########
@@ -302,6 +302,12 @@ private BrokerResponseNative handleSQLRequest(long requestId, String query, Json
     }
     if ((offlineTableName == null) && (realtimeTableName == null)) {
       // No table matches the request
+      if (_tableCache.getTableConfig(TableNameBuilder.REALTIME.tableNameWithType(rawTableName)) == null
+          && _tableCache.getTableConfig(TableNameBuilder.OFFLINE.tableNameWithType(rawTableName)) == null) {
+        LOGGER.info("Table not found for request {}: {}", requestId, query);
+        requestStatistics.setErrorCode(QueryException.TABLE_DOES_NOT_EXIST_ERROR_CODE);
+        return new BrokerResponseNative(QueryException.TABLE_DOES_NOT_EXIST_ERROR);

Review comment:
       Suggest putting another constant response in `BrokerResponseNative` similar to `EMPTY_RESULT` and `NO_TABLE_RESULT` (we should probably rename this)




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org