minor, add RoutingIndicatorException to expected exception when query pushdown.
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/6dbb8402 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/6dbb8402 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/6dbb8402 Branch: refs/heads/master Commit: 6dbb8402e7379c7e59fdf7ce39630a1739b4169d Parents: 617de5c Author: tttMelody <245915...@qq.com> Authored: Wed Sep 27 15:41:09 2017 +0800 Committer: YIMINGXU <100650...@qq.com> Committed: Wed Sep 27 03:10:02 2017 -0500 ---------------------------------------------------------------------- .../org/apache/kylin/query/util/PushDownUtil.java | 15 ++++++++++----- .../org/apache/kylin/rest/service/QueryService.java | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/6dbb8402/query/src/main/java/org/apache/kylin/query/util/PushDownUtil.java ---------------------------------------------------------------------- diff --git a/query/src/main/java/org/apache/kylin/query/util/PushDownUtil.java b/query/src/main/java/org/apache/kylin/query/util/PushDownUtil.java index a9f6c5c..2c93bdf 100644 --- a/query/src/main/java/org/apache/kylin/query/util/PushDownUtil.java +++ b/query/src/main/java/org/apache/kylin/query/util/PushDownUtil.java @@ -133,14 +133,19 @@ public class PushDownUtil { Preconditions.checkArgument(sqlException != null); Throwable rootCause = ExceptionUtils.getRootCause(sqlException); + //SqlValidatorException is not an excepted exception in the origin design.But in the multi pass scene, + //query pushdown may create tables, and the tables are not in the model, so will throw SqlValidatorException. boolean isPushDownUpdateEnabled = KylinConfig.getInstanceFromEnv().isPushDownUpdateEnabled(); + if (!isPushDownUpdateEnabled) { - return rootCause != null && rootCause instanceof NoRealizationFoundException; + return rootCause != null // + && (rootCause instanceof NoRealizationFoundException // + || rootCause instanceof RoutingIndicatorException); // } else { - return (rootCause != null - && (rootCause instanceof NoRealizationFoundException - || rootCause instanceof SqlValidatorException - || rootCause instanceof RoutingIndicatorException)); + return (rootCause != null // + && (rootCause instanceof NoRealizationFoundException // + || rootCause instanceof SqlValidatorException // + || rootCause instanceof RoutingIndicatorException)); // } } http://git-wip-us.apache.org/repos/asf/kylin/blob/6dbb8402/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java ---------------------------------------------------------------------- diff --git a/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java b/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java index 33dd4e8..b31fb3b 100644 --- a/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java +++ b/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java @@ -413,7 +413,7 @@ public class QueryService extends BasicService { if (null == sqlResponse) { if (isSelect) { sqlResponse = query(sqlRequest); - } else if (kylinConfig.isPushDownEnabled()) { + } else if (kylinConfig.isPushDownEnabled() && kylinConfig.isPushDownUpdateEnabled()) { sqlResponse = update(sqlRequest); } else { logger.debug(