You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2016/12/08 05:50:03 UTC

[15/18] kylin git commit: KYLIN-2217 fix null partition col bug

KYLIN-2217 fix null partition col bug

Signed-off-by: Li Yang <li...@apache.org>


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

Branch: refs/heads/master-hbase1.x
Commit: c0c56f4b6b05bb108a4952a56af992b237c1bbe6
Parents: 545201f
Author: xiefan46 <95...@qq.com>
Authored: Thu Dec 8 10:33:48 2016 +0800
Committer: Li Yang <li...@apache.org>
Committed: Thu Dec 8 11:09:31 2016 +0800

----------------------------------------------------------------------
 .../kylin/engine/mr/steps/FactDistinctColumnsReducer.java    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/c0c56f4b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java
----------------------------------------------------------------------
diff --git a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java
index 8933ee2..a3e61a1 100644
--- a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java
+++ b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/FactDistinctColumnsReducer.java
@@ -116,13 +116,17 @@ public class FactDistinctColumnsReducer extends KylinReducer<SelfDefineSortableK
             isStatistics = false;
             isPartitionCol = true;
             col = cubeDesc.getModel().getPartitionDesc().getPartitionDateColumnRef();
+            if (col == null) {
+                isPartitionCol = false;
+                logger.info("Do not have partition col. This reducer will keep empty");
+            }
             colValues = Lists.newLinkedList();
         } else {
             // normal col
             isStatistics = false;
             col = columnList.get(reducerIdToColumnIndex.get(taskId));
             colValues = Lists.newLinkedList();
-            
+
             // local build dict
             isReducerLocalBuildDict = config.isReducerLocalBuildDict();
             if (col != null && isReducerLocalBuildDict) {
@@ -279,6 +283,8 @@ public class FactDistinctColumnsReducer extends KylinReducer<SelfDefineSortableK
                     cuboidHLLMap, samplingPercentage, mapperNumber, mapperOverlapRatio);
         } else if (isPartitionCol) {
             // partition col
+            if (col == null)
+                return;
             outputPartitionInfo(context);
         } else {
             // normal col