From d155af8e664e6957e15ca8739c9bdd8f90983c92 Mon Sep 17 00:00:00 2001 From: Dai Date: Thu, 10 Dec 2020 15:09:50 -0800 Subject: [PATCH] Remove sensitive log and add log for fallback --- .../sql/legacy/plugin/RestSQLQueryAction.java | 4 ++++ .../sql/legacy/plugin/RestSqlAction.java | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) 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",