kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liy...@apache.org
Subject [14/39] incubator-kylin git commit: KYLIN-696 Dictionary couldn't recognize a value and throw IllegalArgumentException: "Not a valid value"
Date Sun, 26 Apr 2015 04:17:46 GMT
KYLIN-696 Dictionary couldn't recognize a value and throw IllegalArgumentException: "Not a
valid value"

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

Branch: refs/heads/staging
Commit: ac5bb81be349a7082de76cbeb92713c9a22e82d1
Parents: 9304cb2
Author: Shao Feng, Shi <shaoshi@ebay.com>
Authored: Mon Apr 20 12:55:07 2015 +0800
Committer: Shao Feng, Shi <shaoshi@ebay.com>
Committed: Mon Apr 20 12:55:07 2015 +0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/kylin/dict/DictionaryManager.java  | 4 ++--
 .../java/org/apache/kylin/metadata/model/DataModelDesc.java     | 5 ++++-
 2 files changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/ac5bb81b/dictionary/src/main/java/org/apache/kylin/dict/DictionaryManager.java
----------------------------------------------------------------------
diff --git a/dictionary/src/main/java/org/apache/kylin/dict/DictionaryManager.java b/dictionary/src/main/java/org/apache/kylin/dict/DictionaryManager.java
index 8e5d599..3a2cb8d 100644
--- a/dictionary/src/main/java/org/apache/kylin/dict/DictionaryManager.java
+++ b/dictionary/src/main/java/org/apache/kylin/dict/DictionaryManager.java
@@ -211,9 +211,9 @@ public class DictionaryManager {
 
         // normal case, source from lookup table
         if ("true".equals(dict) || "string".equals(dict) || "number".equals(dict) || "any".equals(dict))
{
-            // FK on fact table, use PK from lookup instead
+            // FK on fact table and join type is inner, use PK from lookup instead
             if (model.isFactTable(col.getTable())) {
-                TblColRef pkCol = model.findPKByFK(col);
+                TblColRef pkCol = model.findPKByFK(col, "inner");
                 if (pkCol != null)
                     col = pkCol; // scan the counterparty PK on lookup table
                 // instead

http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/ac5bb81b/metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java
----------------------------------------------------------------------
diff --git a/metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java b/metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java
index c9271fc..8a753f7 100644
--- a/metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java
+++ b/metadata/src/main/java/org/apache/kylin/metadata/model/DataModelDesc.java
@@ -119,7 +119,7 @@ public class DataModelDesc extends RootPersistentEntity {
         this.capacity = capacity;
     }
 
-    public TblColRef findPKByFK(TblColRef fk) {
+    public TblColRef findPKByFK(TblColRef fk, String joinType) {
         assert isFactTable(fk.getTable());
 
         TblColRef candidate = null;
@@ -129,6 +129,9 @@ public class DataModelDesc extends RootPersistentEntity {
             if (join == null)
                 continue;
 
+            if(joinType != null && !joinType.equals(join.getType()))
+                continue;
+
             int find = ArrayUtils.indexOf(join.getForeignKeyColumns(), fk);
             if (find >= 0) {
                 candidate = join.getPrimaryKeyColumns()[find];


Mime
View raw message