kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kangkai...@apache.org
Subject [36/50] [abbrv] kylin git commit: minor, roll back validate join key
Date Fri, 07 Jul 2017 08:38:38 GMT
minor, roll back validate join key


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

Branch: refs/heads/KYLIN-2606
Commit: 3ae8ca7cd3796583787e0657edec31b8bdb30ce1
Parents: dc232d1
Author: Cheng Wang <cheng.wang@kyligence.io>
Authored: Fri Jun 30 20:26:31 2017 +0800
Committer: liyang-gmt8 <liyang@apache.org>
Committed: Fri Jun 30 20:29:11 2017 +0800

----------------------------------------------------------------------
 .../kylin/metadata/model/DataModelDesc.java     | 31 --------------------
 1 file changed, 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/3ae8ca7c/core-metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java
b/core-metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java
index abee71b..bc35e2a 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java
@@ -617,38 +617,7 @@ public class DataModelDesc extends RootPersistentEntity {
                             + fkCols[i].getDatatype());
                 }
             }
-
-            if (!isSpecialTestModel()) {
-                for (TblColRef t : fkCols) {
-                    if (!isJoinKeyDimension(t.getIdentity())) {
-                        throw new IllegalStateException(
-                                "Foreigner key: " + t.getIdentity() + " should be a dimension.");
-                    }
-                }
-
-                for (TblColRef t : pkCols) {
-                    if (!isJoinKeyDimension(t.getIdentity())) {
-                        throw new IllegalStateException("Primary key: " + t.getIdentity()
+ " should be a dimension.");
-                    }
-                }
-            }
-        }
-    }
-
-    private boolean isJoinKeyDimension(String key) {
-        for (ModelDimensionDesc d : dimensions) {
-            for (String col : d.getColumns()) {
-                if (key.equals(d.getTable() + '.' + col))
-                    return true;
-            }
         }
-        return false;
-    }
-
-    private boolean isSpecialTestModel() {
-        if (config.isDevEnv() && (name.startsWith("test_kylin_") || name.startsWith("test_streaming")))
-            return true;
-        return false;
     }
 
     private void initJoinsTree() {


Mime
View raw message