Skip to content

Commit

Permalink
Fail multi-stage client queries in the broker if multi-stage engine i…
Browse files Browse the repository at this point in the history
…s disabled (apache#13732)
  • Loading branch information
yashmayya authored Aug 2, 2024
1 parent 55fd6d2 commit e767e58
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,15 @@ public BrokerResponse handleRequest(JsonNode request, @Nullable SqlNodeAndOption
return new BrokerResponseNative(QueryException.getException(QueryException.SQL_PARSING_ERROR, e));
}
}
if (_multiStageBrokerRequestHandler != null && QueryOptionsUtils.isUseMultistageEngine(
sqlNodeAndOptions.getOptions())) {
return _multiStageBrokerRequestHandler.handleRequest(request, sqlNodeAndOptions, requesterIdentity,
requestContext, httpHeaders);

if (QueryOptionsUtils.isUseMultistageEngine(sqlNodeAndOptions.getOptions())) {
if (_multiStageBrokerRequestHandler != null) {
return _multiStageBrokerRequestHandler.handleRequest(request, sqlNodeAndOptions, requesterIdentity,
requestContext, httpHeaders);
} else {
return new BrokerResponseNative(QueryException.getException(QueryException.INTERNAL_ERROR,
"V2 Multi-Stage query engine not enabled."));
}
} else {
return _singleStageBrokerRequestHandler.handleRequest(request, sqlNodeAndOptions, requesterIdentity,
requestContext, httpHeaders);
Expand Down

0 comments on commit e767e58

Please sign in to comment.