Repository: kylin Updated Branches: refs/heads/yang22-cdh5.7 6144e8ec0 -> 4ae2df2d3 (forced update)
KYLIN-2217 fix null partition col bug Signed-off-by: Li Yang <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/ae31b13e Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/ae31b13e Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/ae31b13e Branch: refs/heads/yang22-cdh5.7 Commit: ae31b13e70ab214a3b5c320f3c2094e1e8c022ef Parents: 43805bc Author: xiefan46 <[email protected]> Authored: Thu Dec 8 10:33:48 2016 +0800 Committer: Li Yang <[email protected]> Committed: Thu Dec 8 11:10:49 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/ae31b13e/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
