Fix Router handling of SQL queries. (#4851)

This commit is contained in:
Gian Merlino 2017-09-27 10:58:24 -07:00 committed by GitHub
parent 9c126e2aa9
commit 999c6d800e
1 changed files with 4 additions and 1 deletions

View File

@ -181,7 +181,10 @@ public class AsyncQueryForwardingServlet extends AsyncProxyServlet implements Qu
request.setAttribute(HOST_ATTRIBUTE, defaultServer.getHost());
request.setAttribute(SCHEME_ATTRIBUTE, defaultServer.getScheme());
final boolean isQueryEndpoint = request.getRequestURI().startsWith("/druid/v2");
// The Router does not have the ability to look inside SQL queries and route them intelligently, so just treat
// them as a generic request.
final boolean isQueryEndpoint = request.getRequestURI().startsWith("/druid/v2")
&& !request.getRequestURI().startsWith("/druid/v2/sql");
if (isQueryEndpoint && HttpMethod.DELETE.is(request.getMethod())) {
// query cancellation request