You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2016/11/19 08:32:47 UTC

[3/3] kylin git commit: KYLIN-2178 fix CubeDescTest

KYLIN-2178 fix CubeDescTest


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

Branch: refs/heads/v1.6.0-rc2
Commit: 81a2fb7529a43d6d9e5ce5d36f0696aac4e64613
Parents: a1bc835
Author: shaofengshi <sh...@apache.org>
Authored: Sat Nov 19 16:32:34 2016 +0800
Committer: shaofengshi <sh...@apache.org>
Committed: Sat Nov 19 16:32:34 2016 +0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/kylin/cube/model/CubeDesc.java    | 5 ++---
 .../kylin/cube/model/validation/rule/AggregationGroupRule.java | 6 +++---
 2 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/81a2fb75/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java b/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
index 6cbed80..4a5747b 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/model/CubeDesc.java
@@ -29,7 +29,6 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
 import java.util.List;
@@ -686,8 +685,8 @@ public class CubeDesc extends RootPersistentEntity implements IEngineAware {
     }
 
     private Pair<Boolean, Set<String>> hasOverlap(ArrayList<Set<String>> dimsList, Set<String> Dims) {
-        Set<String> existing = new HashSet<>();
-        Set<String> overlap = new HashSet<>();
+        Set<String> existing = new TreeSet<>();
+        Set<String> overlap = new TreeSet<>();
         for (Set<String> dims : dimsList) {
             if (CollectionUtils.containsAny(existing, dims)) {
                 overlap.addAll(CollectionUtils.intersection(existing, dims));

http://git-wip-us.apache.org/repos/asf/kylin/blob/81a2fb75/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/AggregationGroupRule.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/AggregationGroupRule.java b/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/AggregationGroupRule.java
index a5cf407..341efe7 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/AggregationGroupRule.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/model/validation/rule/AggregationGroupRule.java
@@ -62,7 +62,7 @@ public class AggregationGroupRule implements IValidatorRule<CubeDesc> {
                 continue;
             }
 
-            long combination = 1;
+            long combination = 1;
             Set<String> includeDims = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
             if (agg.getIncludes() != null) {
                 for (String include : agg.getIncludes()) {
@@ -115,10 +115,10 @@ public class AggregationGroupRule implements IValidatorRule<CubeDesc> {
             normalDims.removeAll(hierarchyDims);
             normalDims.removeAll(jointDims);
 
-            combination = combination * (1L << normalDims.size());
+            combination = combination * (1L << normalDims.size());
 
             if (CollectionUtils.containsAny(mandatoryDims, hierarchyDims)) {
-                Set<String> intersection = new HashSet<>(mandatoryDims);
+                Set<String> intersection = new TreeSet<>(mandatoryDims);
                 intersection.retainAll(hierarchyDims);
                 context.addResult(ResultLevel.ERROR, "Aggregation group " + index + " mandatory dimension has overlap with hierarchy dimension: " + intersection.toString());
                 continue;