Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CBD0D200C10 for ; Thu, 19 Jan 2017 10:04:45 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id CAAD6160B42; Thu, 19 Jan 2017 09:04:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id E3348160B5E for ; Thu, 19 Jan 2017 10:04:44 +0100 (CET) Received: (qmail 16579 invoked by uid 500); 19 Jan 2017 09:04:44 -0000 Mailing-List: contact commits-help@kylin.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kylin.apache.org Delivered-To: mailing list commits@kylin.apache.org Received: (qmail 16255 invoked by uid 99); 19 Jan 2017 09:04:44 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jan 2017 09:04:43 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B88B8F1736; Thu, 19 Jan 2017 09:04:43 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: lidong@apache.org To: commits@kylin.apache.org Date: Thu, 19 Jan 2017 09:04:49 -0000 Message-Id: In-Reply-To: <182501c139d649d1b820c4b1ce8df97a@git.apache.org> References: <182501c139d649d1b820c4b1ce8df97a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [07/12] kylin git commit: KYLIN-2348 let choose model freely for sub-queries archived-at: Thu, 19 Jan 2017 09:04:45 -0000 KYLIN-2348 let choose model freely for sub-queries Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/d52bb8bc Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/d52bb8bc Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/d52bb8bc Branch: refs/heads/master-cdh5.7 Commit: d52bb8bc05bd530362fe0970b8e8a85f8b2289bc Parents: 51c6571 Author: Li Yang Authored: Wed Jan 18 22:46:24 2017 +0800 Committer: Li Yang Committed: Wed Jan 18 22:46:24 2017 +0800 ---------------------------------------------------------------------- .../apache/kylin/query/relnode/OLAPTableScan.java | 2 ++ .../apache/kylin/query/routing/ModelChooser.java | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/d52bb8bc/query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java ---------------------------------------------------------------------- diff --git a/query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java b/query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java index 452170a..f7877be 100644 --- a/query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java +++ b/query/src/main/java/org/apache/kylin/query/relnode/OLAPTableScan.java @@ -53,6 +53,7 @@ import org.apache.calcite.rel.rules.JoinPushExpressionsRule; import org.apache.calcite.rel.rules.JoinPushThroughJoinRule; import org.apache.calcite.rel.rules.JoinUnionTransposeRule; import org.apache.calcite.rel.rules.ReduceExpressionsRule; +import org.apache.calcite.rel.rules.SemiJoinRule; import org.apache.calcite.rel.rules.SortJoinTransposeRule; import org.apache.calcite.rel.rules.SortUnionTransposeRule; import org.apache.calcite.rel.type.RelDataType; @@ -174,6 +175,7 @@ public class OLAPTableScan extends TableScan implements OLAPRel, EnumerableRel { planner.removeRule(JoinUnionTransposeRule.RIGHT_UNION); planner.removeRule(AggregateUnionTransposeRule.INSTANCE); planner.removeRule(DateRangeRules.FILTER_INSTANCE); + planner.removeRule(SemiJoinRule.INSTANCE); // distinct count will be split into a separated query that is joined with the left query planner.removeRule(AggregateExpandDistinctAggregatesRule.INSTANCE); http://git-wip-us.apache.org/repos/asf/kylin/blob/d52bb8bc/query/src/main/java/org/apache/kylin/query/routing/ModelChooser.java ---------------------------------------------------------------------- diff --git a/query/src/main/java/org/apache/kylin/query/routing/ModelChooser.java b/query/src/main/java/org/apache/kylin/query/routing/ModelChooser.java index 2517dc5..f979f7b 100644 --- a/query/src/main/java/org/apache/kylin/query/routing/ModelChooser.java +++ b/query/src/main/java/org/apache/kylin/query/routing/ModelChooser.java @@ -53,17 +53,17 @@ public class ModelChooser { IdentityHashMap> candidates = new IdentityHashMap<>(); // attempt one model for all contexts - Set reals = attemptSelectModel(contexts); - if (reals != null) { - for (OLAPContext ctx : contexts) { - candidates.put(ctx, reals); - } - return candidates; - } + // Set reals = attemptSelectModel(contexts); + // if (reals != null) { + // for (OLAPContext ctx : contexts) { + // candidates.put(ctx, reals); + // } + // return candidates; + // } // try different model for different context for (OLAPContext ctx : contexts) { - reals = attemptSelectModel(ImmutableList.of(ctx)); + Set reals = attemptSelectModel(ImmutableList.of(ctx)); if (reals == null) throw new NoRealizationFoundException("No model found for" + toErrorMsg(ctx));