Repository: kylin
Updated Branches:
  refs/heads/KYLIN-2800 ac77008ee -> 7bdce5e87


KYLIN-2800 minor refactor


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

Branch: refs/heads/KYLIN-2800
Commit: 7bdce5e873179c5612415ee66b8470e2fd041737
Parents: ac77008
Author: Li Yang <liy...@apache.org>
Authored: Wed Sep 6 14:23:44 2017 +0800
Committer: Li Yang <liy...@apache.org>
Committed: Wed Sep 6 14:23:44 2017 +0800

----------------------------------------------------------------------
 .../kylin/cube/cli/DictionaryGeneratorCLI.java      | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/7bdce5e8/core-cube/src/main/java/org/apache/kylin/cube/cli/DictionaryGeneratorCLI.java
----------------------------------------------------------------------
diff --git 
a/core-cube/src/main/java/org/apache/kylin/cube/cli/DictionaryGeneratorCLI.java 
b/core-cube/src/main/java/org/apache/kylin/cube/cli/DictionaryGeneratorCLI.java
index f8b6d61..65e8965 100644
--- 
a/core-cube/src/main/java/org/apache/kylin/cube/cli/DictionaryGeneratorCLI.java
+++ 
b/core-cube/src/main/java/org/apache/kylin/cube/cli/DictionaryGeneratorCLI.java
@@ -56,15 +56,15 @@ public class DictionaryGeneratorCLI {
         for (TblColRef col : 
cubeSeg.getCubeDesc().getAllColumnsNeedDictionaryBuilt()) {
             logger.info("Building dictionary for " + col);
             IReadableTable inpTable = 
factTableValueProvider.getDistinctValuesFor(col);
+            
+            Dictionary<String> preBuiltDict = null;
             if (dictProvider != null) {
-                Dictionary<String> dict = dictProvider.getDictionary(col);
-                if (dict != null) {
-                    logger.debug("Dict for '" + col.getName() + "' has already 
been built, save it");
-                    cubeMgr.saveDictionary(cubeSeg, col, inpTable, dict);
-                } else {
-                    logger.debug("Dict for '" + col.getName() + "' not 
pre-built, build it from " + inpTable.toString());
-                    cubeMgr.buildDictionary(cubeSeg, col, inpTable);
-                }
+                preBuiltDict = dictProvider.getDictionary(col);
+            }
+        
+            if (preBuiltDict != null) {
+                logger.debug("Dict for '" + col.getName() + "' has already 
been built, save it");
+                cubeMgr.saveDictionary(cubeSeg, col, inpTable, preBuiltDict);
             } else {
                 logger.debug("Dict for '" + col.getName() + "' not pre-built, 
build it from " + inpTable.toString());
                 cubeMgr.buildDictionary(cubeSeg, col, inpTable);

Reply via email to