Merge commit 'aee88fe9415bdf3eb2dd4103fee795b03ebac255' into kap-2.4.x
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/e2bd2eb7 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/e2bd2eb7 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/e2bd2eb7 Branch: refs/heads/2.1.x Commit: e2bd2eb75901fb1dc1d079c1ca14b051344db1bc Parents: d188ee6 aee88fe Author: Hongbin Ma <mahong...@apache.org> Authored: Tue Jul 25 17:41:27 2017 +0800 Committer: Hongbin Ma <mahong...@apache.org> Committed: Tue Jul 25 17:41:27 2017 +0800 ---------------------------------------------------------------------- .../job/execution/DefaultChainedExecutable.java | 20 +++---- .../kylin/job/execution/ExecutableManager.java | 12 +++-- .../apache/kylin/metadata/MetadataManager.java | 1 + pom.xml | 2 +- .../query/adhoc/PushDownRunnerJdbcImpl.java | 17 +++--- .../rest/service/AclTableMigrationTool.java | 12 +++-- .../apache/kylin/rest/service/JobService.java | 4 ++ .../apache/kylin/rest/service/QueryService.java | 5 +- .../apache/kylin/rest/util/PushDownUtil.java | 1 - server/src/main/resources/kylinSecurity.xml | 2 + .../kylin/rest/service/JobServiceTest.java | 38 ++++++++++++++ .../apache/kylin/source/jdbc/JdbcExplorer.java | 6 ++- webapp/app/css/AdminLTE.css | 6 ++- webapp/app/js/controllers/access.js | 1 - webapp/app/js/controllers/cubeAdvanceSetting.js | 8 ++- webapp/app/js/controllers/cubeEdit.js | 52 ++++++++++++++++++ webapp/app/js/controllers/cubeMeasures.js | 52 ++++++++++++++---- webapp/app/js/controllers/modelDataModel.js | 3 +- webapp/app/js/controllers/sourceMeta.js | 2 - webapp/app/js/model/cubeDescModel.js | 6 --- webapp/app/js/model/cubeListModel.js | 1 - webapp/app/js/model/jobListModel.js | 4 -- webapp/app/js/model/streamingListModel.js | 6 --- webapp/app/less/layout.less | 2 +- webapp/app/partials/admin/admin.html | 16 +++--- .../cubeDesigner/advanced_settings.html | 55 ++++++++++++++------ webapp/app/partials/cubeDesigner/info.html | 2 +- webapp/app/partials/cubeDesigner/measures.html | 18 +++---- webapp/app/partials/cubes/cube_json_edit.html | 2 +- .../app/partials/modelDesigner/data_model.html | 4 +- .../app/partials/modelDesigner/model_info.html | 2 +- .../app/partials/projects/project_create.html | 2 +- .../app/partials/projects/project_detail.html | 2 +- 33 files changed, 248 insertions(+), 118 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/e2bd2eb7/core-job/src/main/java/org/apache/kylin/job/execution/DefaultChainedExecutable.java ---------------------------------------------------------------------- diff --cc core-job/src/main/java/org/apache/kylin/job/execution/DefaultChainedExecutable.java index 4f5c02b,cbd49ae..3efa5a8 mode 100644,100755..100755 --- a/core-job/src/main/java/org/apache/kylin/job/execution/DefaultChainedExecutable.java +++ b/core-job/src/main/java/org/apache/kylin/job/execution/DefaultChainedExecutable.java @@@ -43,7 -43,7 +43,7 @@@ public class DefaultChainedExecutable e sub.initConfig(config); } } -- ++ @Override protected ExecuteResult doWork(ExecutableContext context) throws ExecuteException { List<? extends Executable> executables = getTasks(); @@@ -58,7 -58,7 +58,8 @@@ // the job is paused break; } else if (state == ExecutableState.ERROR) { -- throw new IllegalStateException("invalid subtask state, subtask:" + subTask.getName() + ", state:" + subTask.getStatus()); ++ throw new IllegalStateException( ++ "invalid subtask state, subtask:" + subTask.getName() + ", state:" + subTask.getStatus()); } if (subTask.isRunnable()) { return subTask.execute(context); @@@ -97,7 -88,7 +89,7 @@@ @Override protected void onExecuteFinished(ExecuteResult result, ExecutableContext executableContext) { ExecutableManager mgr = getManager(); -- ++ if (isDiscarded()) { setEndTime(System.currentTimeMillis()); notifyUserStatusChange(executableContext, ExecutableState.DISCARDED); http://git-wip-us.apache.org/repos/asf/kylin/blob/e2bd2eb7/pom.xml ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/e2bd2eb7/server-base/src/main/java/org/apache/kylin/rest/service/AclTableMigrationTool.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/e2bd2eb7/server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/e2bd2eb7/server-base/src/main/java/org/apache/kylin/rest/util/PushDownUtil.java ---------------------------------------------------------------------- diff --cc server-base/src/main/java/org/apache/kylin/rest/util/PushDownUtil.java index 0802718,5d7f47a..c21d5c2 --- a/server-base/src/main/java/org/apache/kylin/rest/util/PushDownUtil.java +++ b/server-base/src/main/java/org/apache/kylin/rest/util/PushDownUtil.java @@@ -49,16 -49,12 +49,15 @@@ public class PushDownUtil public static boolean doPushDownQuery(String project, String sql, List<List<String>> results, List<SelectedColumnMeta> columnMetas, SQLException sqlException) throws Exception { - boolean isExpectedCause = (ExceptionUtils.getRootCause(sqlException).getClass() - .equals(NoRealizationFoundException.class)); KylinConfig kylinConfig = KylinConfig.getInstanceFromEnv(); + if (!kylinConfig.isPushDownEnabled()) { + return false; + } - if (isExpectedCause && kylinConfig.isPushDownEnabled()) { + Throwable rootCause = ExceptionUtils.getRootCause(sqlException); + boolean isExpectedCause = rootCause != null && (rootCause.getClass().equals(NoRealizationFoundException.class)); + if (isExpectedCause) { - logger.info("Query failed to utilize pre-calculation, routing to other engines", sqlException); IPushDownRunner runner = (IPushDownRunner) ClassUtil.newInstance(kylinConfig.getPushDownRunnerClassName()); IPushDownConverter converter = (IPushDownConverter) ClassUtil http://git-wip-us.apache.org/repos/asf/kylin/blob/e2bd2eb7/server/src/test/java/org/apache/kylin/rest/service/JobServiceTest.java ---------------------------------------------------------------------- diff --cc server/src/test/java/org/apache/kylin/rest/service/JobServiceTest.java index b47f05f,a509f88..3ad0c0e --- a/server/src/test/java/org/apache/kylin/rest/service/JobServiceTest.java +++ b/server/src/test/java/org/apache/kylin/rest/service/JobServiceTest.java @@@ -19,12 -19,20 +19,22 @@@ package org.apache.kylin.rest.service; import java.io.IOException; +import java.sql.SQLException; + import java.util.Collections; + import java.util.List; + import org.apache.kylin.engine.mr.CubingJob; import org.apache.kylin.job.constant.JobTimeFilterEnum; + import org.apache.kylin.job.exception.ExecuteException; import org.apache.kylin.job.exception.JobException; + import org.apache.kylin.job.execution.AbstractExecutable; + import org.apache.kylin.job.execution.ExecutableContext; + import org.apache.kylin.job.execution.ExecutableManager; + import org.apache.kylin.job.execution.ExecutableState; + import org.apache.kylin.job.execution.ExecuteResult; + import org.apache.kylin.job.execution.Output; import org.apache.kylin.metadata.project.ProjectInstance; +import org.apache.kylin.query.QueryConnection; import org.junit.Assert; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired;