diff --git a/legacy/src/main/java/com/amazon/opendistroforelasticsearch/sql/legacy/plugin/RestSQLQueryAction.java b/legacy/src/main/java/com/amazon/opendistroforelasticsearch/sql/legacy/plugin/RestSQLQueryAction.java index 565fb69638..c60111f3fe 100644 --- a/legacy/src/main/java/com/amazon/opendistroforelasticsearch/sql/legacy/plugin/RestSQLQueryAction.java +++ b/legacy/src/main/java/com/amazon/opendistroforelasticsearch/sql/legacy/plugin/RestSQLQueryAction.java @@ -106,6 +106,10 @@ public RestChannelConsumer prepareRequest(SQLQueryRequest request, NodeClient no sqlService.analyze( sqlService.parse(request.getQuery()))); } catch (SyntaxCheckException e) { + // When explain, print info log for what unsupported syntax is causing fallback to old engine + if (request.isExplainRequest()) { + LOG.info("Request is falling back to old SQL engine due to: " + e.getMessage()); + } return NOT_SUPPORTED_YET; } diff --git a/legacy/src/main/java/com/amazon/opendistroforelasticsearch/sql/legacy/plugin/RestSqlAction.java b/legacy/src/main/java/com/amazon/opendistroforelasticsearch/sql/legacy/plugin/RestSqlAction.java index 444f6e4aed..da8b064469 100644 --- a/legacy/src/main/java/com/amazon/opendistroforelasticsearch/sql/legacy/plugin/RestSqlAction.java +++ b/legacy/src/main/java/com/amazon/opendistroforelasticsearch/sql/legacy/plugin/RestSqlAction.java @@ -156,8 +156,7 @@ protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient cli format.getFormatName()); RestChannelConsumer result = newSqlQueryHandler.prepareRequest(newSqlRequest, client); if (result != RestSQLQueryAction.NOT_SUPPORTED_YET) { - LOG.info("[{}] Request {} is handled by new SQL query engine", - LogUtils.getRequestId(), newSqlRequest); + LOG.info("[{}] Request is handled by new SQL query engine", LogUtils.getRequestId()); return result; } LOG.debug("[{}] Request {} is not supported and falling back to old SQL engine",