real-mj-song commented on code in PR #14917:
URL: https://github.com/apache/pinot/pull/14917#discussion_r1931202737
##########
pinot-broker/src/main/java/org/apache/pinot/broker/requesthandler/MultiStageBrokerRequestHandler.java:
##########
@@ -269,11 +271,17 @@ protected BrokerResponse handleRequest(long requestId,
String query, SqlNodeAndO
requestContext.setErrorCode(QueryException.EXECUTION_TIMEOUT_ERROR_CODE);
return new
BrokerResponseNative(QueryException.EXECUTION_TIMEOUT_ERROR);
} catch (Throwable t) {
+ ProcessingException queryException =
QueryException.QUERY_EXECUTION_ERROR;
+ if (t instanceof BadQueryRequestException) {
+ // provide more specific error code if available
+ queryException = QueryException.QUERY_VALIDATION_ERROR;
Review Comment:
Diagrams for these two error reporting scenarios. Many middle steps are
omitted and only relevant steps are shown 👇🏼
```
PinotClientRequest::processSqlQueryPost
- BaseSingleStageBrokerRequestHandler::handleRequest
- SingleConnectionBrokerRequestHandler::processBrokerRequest // broker
metric is updated here
- ServerQueryExecutorV1Impl::executeInternal //
BadQueryRequestException is caught. InstanceResponseBlock is updated here
- SingleConnectionBrokerRequestHandler::processBrokerRequest // No
exception is caught here. Error code is embedded inside brokerResponse
PinotClientRequest::getPinotQueryResponse // 700 error code is parsed
```
MultiStage query
```
PinotClientRequest::processSqlQueryPost
- MultiStageBrokerRequestHandler::handleRequest
- QueryDispatcher::submitAndReduce // exception is thrown if ANY block
errors. I re-throw BadQueryRequestException here
- MultiStageBrokerRequestHandler::handleRequest // catch
BadQueryRequestException. Exceptions in requestContext are added to
brokerResponse via augmentStatistics
PinotClientRequest::getPinotQueryResponse // 700 error code is parsed
```
--
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]