kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaofeng...@apache.org
Subject incubator-kylin git commit: KYLIN-915 appendDBName in CubeMetadataUpgrade will return null
Date Wed, 29 Jul 2015 05:58:40 GMT
Repository: incubator-kylin
Updated Branches:
  refs/heads/0.7-staging b13b38265 -> 32b66d3fd


KYLIN-915 appendDBName in CubeMetadataUpgrade will return null


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

Branch: refs/heads/0.7-staging
Commit: 32b66d3fd629aad9acbd1cf90034773f31267e58
Parents: b13b382
Author: shaofengshi <shaofengshi@apache.org>
Authored: Wed Jul 29 13:57:18 2015 +0800
Committer: shaofengshi <shaofengshi@apache.org>
Committed: Wed Jul 29 13:58:26 2015 +0800

----------------------------------------------------------------------
 .../org/apache/kylin/job/CubeMetadataUpgrade.java | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/32b66d3f/job/src/main/java/org/apache/kylin/job/CubeMetadataUpgrade.java
----------------------------------------------------------------------
diff --git a/job/src/main/java/org/apache/kylin/job/CubeMetadataUpgrade.java b/job/src/main/java/org/apache/kylin/job/CubeMetadataUpgrade.java
index a373456..317e41c 100644
--- a/job/src/main/java/org/apache/kylin/job/CubeMetadataUpgrade.java
+++ b/job/src/main/java/org/apache/kylin/job/CubeMetadataUpgrade.java
@@ -316,14 +316,14 @@ public class CubeMetadataUpgrade {
             return result;
 
         if (count > 1) {
-            errorMsgs.add("There are more than 1 table named with '" + table + "' in different
database; The program couldn't determine, randomly pick '" + result + "'");
+            errorMsgs.add("There are more than 1 table named with '" + table + "' in different
database; ");
         }
 
         if (count == 0) {
-            errorMsgs.add("There is no table named with '" + table + "'");
+            errorMsgs.add("No table definition for '" + table + "'; any project, cube refers
it should remove the reference;");
         }
-
-        return result;
+        
+        return null;
     }
 
     private void upgradeProjectInstance() {
@@ -351,7 +351,9 @@ public class CubeMetadataUpgrade {
 
                 Set<String> tables = Sets.newHashSet();
                 for (String table : oldPrj.getTables()) {
-                    tables.add(this.appendDBName(table));
+                    String tb = this.appendDBName(table);
+                    if (tb != null)
+                        tables.add(this.appendDBName(tb));
                 }
                 newPrj.setTables(tables);
 
@@ -467,8 +469,8 @@ public class CubeMetadataUpgrade {
                 for (LookupDesc lookupDesc : dataModelDesc.getLookups()) {
                     if (lookupDesc.getJoin() != null) {
                         JoinDesc join = lookupDesc.getJoin();
-                        for (int i=0; i< join.getForeignKey().length; i++) {
-                            pkToFK.put(lookupDesc.getTable() + "/" +join.getPrimaryKey()[i],
dataModelDesc.getFactTable() + "/" +join.getForeignKey()[i]);
+                        for (int i = 0; i < join.getForeignKey().length; i++) {
+                            pkToFK.put(lookupDesc.getTable() + "/" + join.getPrimaryKey()[i],
dataModelDesc.getFactTable() + "/" + join.getForeignKey()[i]);
                         }
                     }
                 }
@@ -487,7 +489,7 @@ public class CubeMetadataUpgrade {
 
                         }
                     }
-                    for(Pair<String, String> dict: newDictionaries) {
+                    for (Pair<String, String> dict : newDictionaries) {
                         newSeg.getDictionaries().put(dict.getFirst(), dict.getSecond());
                         updated = true;
                     }


Mime
View raw message