You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by lu...@apache.org on 2015/05/01 16:06:15 UTC

[08/12] incubator-kylin git commit: KYLIN-739, Dimension as metrics does not work with PK-FK derived column

KYLIN-739, Dimension as metrics does not work with PK-FK derived column


Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/9d67534d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/9d67534d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/9d67534d

Branch: refs/heads/0.7.1
Commit: 9d67534d25e43cade94b3ebc0a05194292cfd736
Parents: 0c8d793
Author: Li, Yang <ya...@ebay.com>
Authored: Wed Apr 29 10:43:05 2015 +0800
Committer: Li, Yang <ya...@ebay.com>
Committed: Wed Apr 29 10:43:05 2015 +0800

----------------------------------------------------------------------
 .../AdjustForWeeklyMatchedRealization.java       |  1 -
 query/src/test/resources/query/sql/query79.sql   | 19 +++++++++++++++++++
 .../org/apache/kylin/storage/StorageContext.java | 17 +++--------------
 .../kylin/storage/hbase/CubeStorageEngine.java   |  1 -
 4 files changed, 22 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9d67534d/query/src/main/java/org/apache/kylin/query/routing/RoutingRules/AdjustForWeeklyMatchedRealization.java
----------------------------------------------------------------------
diff --git a/query/src/main/java/org/apache/kylin/query/routing/RoutingRules/AdjustForWeeklyMatchedRealization.java b/query/src/main/java/org/apache/kylin/query/routing/RoutingRules/AdjustForWeeklyMatchedRealization.java
index 7a36cf1..df58944 100644
--- a/query/src/main/java/org/apache/kylin/query/routing/RoutingRules/AdjustForWeeklyMatchedRealization.java
+++ b/query/src/main/java/org/apache/kylin/query/routing/RoutingRules/AdjustForWeeklyMatchedRealization.java
@@ -85,7 +85,6 @@ public class AdjustForWeeklyMatchedRealization extends RoutingRule {
                 if (col != null) {
                     olapContext.metricsColumns.remove(col);
                     olapContext.groupByColumns.add(col);
-                    olapContext.storageContext.addOtherMandatoryColumns(col);
                 }
                 logger.info("Adjust OLAPContext for " + functionDesc);
             }

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9d67534d/query/src/test/resources/query/sql/query79.sql
----------------------------------------------------------------------
diff --git a/query/src/test/resources/query/sql/query79.sql b/query/src/test/resources/query/sql/query79.sql
new file mode 100644
index 0000000..d89b14f
--- /dev/null
+++ b/query/src/test/resources/query/sql/query79.sql
@@ -0,0 +1,19 @@
+--
+-- Licensed to the Apache Software Foundation (ASF) under one
+-- or more contributor license agreements.  See the NOTICE file
+-- distributed with this work for additional information
+-- regarding copyright ownership.  The ASF licenses this file
+-- to you under the Apache License, Version 2.0 (the
+-- "License"); you may not use this file except in compliance
+-- with the License.  You may obtain a copy of the License at
+--
+--     http://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+select max(cal_dt) from test_kylin_fact

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9d67534d/storage/src/main/java/org/apache/kylin/storage/StorageContext.java
----------------------------------------------------------------------
diff --git a/storage/src/main/java/org/apache/kylin/storage/StorageContext.java b/storage/src/main/java/org/apache/kylin/storage/StorageContext.java
index fac99cc..d80e07d 100644
--- a/storage/src/main/java/org/apache/kylin/storage/StorageContext.java
+++ b/storage/src/main/java/org/apache/kylin/storage/StorageContext.java
@@ -19,16 +19,15 @@
 package org.apache.kylin.storage;
 
 import java.util.ArrayList;
-import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 
-import com.google.common.collect.BiMap;
-import com.google.common.collect.HashBiMap;
 import org.apache.kylin.cube.cuboid.Cuboid;
 import org.apache.kylin.metadata.model.MeasureDesc;
 import org.apache.kylin.metadata.model.TblColRef;
 
+import com.google.common.collect.BiMap;
+import com.google.common.collect.HashBiMap;
+
 /**
  * @author xjiang
  */
@@ -51,7 +50,6 @@ public class StorageContext {
     private BiMap<TblColRef, String> aliasMap;
 
     private boolean exactAggregation;
-    private Set<TblColRef> otherMandatoryColumns;
     private boolean enableLimit;
     private boolean enableCoprocessor;
 
@@ -70,7 +68,6 @@ public class StorageContext {
         this.sortMeasures = new ArrayList<MeasureDesc>();
 
         this.exactAggregation = false;
-        this.otherMandatoryColumns = new HashSet<TblColRef>();
         this.enableLimit = false;
         this.enableCoprocessor = false;
 
@@ -185,14 +182,6 @@ public class StorageContext {
         return this.exactAggregation;
     }
 
-    public void addOtherMandatoryColumns(TblColRef col) {
-        this.otherMandatoryColumns.add(col);
-    }
-
-    public Set<TblColRef> getOtherMandatoryColumns() {
-        return this.otherMandatoryColumns;
-    }
-
     public void enableCoprocessor() {
         this.enableCoprocessor = true;
     }

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/9d67534d/storage/src/main/java/org/apache/kylin/storage/hbase/CubeStorageEngine.java
----------------------------------------------------------------------
diff --git a/storage/src/main/java/org/apache/kylin/storage/hbase/CubeStorageEngine.java b/storage/src/main/java/org/apache/kylin/storage/hbase/CubeStorageEngine.java
index 8737e8c..cd671ba 100644
--- a/storage/src/main/java/org/apache/kylin/storage/hbase/CubeStorageEngine.java
+++ b/storage/src/main/java/org/apache/kylin/storage/hbase/CubeStorageEngine.java
@@ -112,7 +112,6 @@ public class CubeStorageEngine implements IStorageEngine {
         // - columns on non-evaluatable filter have to return
         // - columns on loosened filter (due to derived translation) have to return
         Set<TblColRef> groupsCopD = Sets.newHashSet(groupsD);
-        groupsCopD.addAll(context.getOtherMandatoryColumns()); // TODO: this is tricky, to generalize
         collectNonEvaluable(filter, groupsCopD);
         TupleFilter filterD = translateDerived(filter, groupsCopD);