You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by bi...@apache.org on 2017/02/08 06:03:40 UTC
[3/8] kylin git commit: KYLIN-2433 Fix NPE in MergeCuboidMapper
KYLIN-2433 Fix NPE in MergeCuboidMapper
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/b32cc954
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/b32cc954
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/b32cc954
Branch: refs/heads/KYLIN-2428
Commit: b32cc9545a76657570c4a3353469ded43892c772
Parents: 6d11dd1
Author: kangkaisen <ka...@163.com>
Authored: Fri Feb 3 14:00:50 2017 +0800
Committer: kangkaisen <ka...@163.com>
Committed: Tue Feb 7 17:20:30 2017 +0800
----------------------------------------------------------------------
.../apache/kylin/engine/mr/steps/MergeCuboidMapper.java | 10 ++++++++++
1 file changed, 10 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/b32cc954/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/MergeCuboidMapper.java
----------------------------------------------------------------------
diff --git a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/MergeCuboidMapper.java b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/MergeCuboidMapper.java
index 047e2b1..acf1403 100644
--- a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/MergeCuboidMapper.java
+++ b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/MergeCuboidMapper.java
@@ -129,6 +129,11 @@ public class MergeCuboidMapper extends KylinMapper<Text, Text, Text, Text> {
List<TblColRef> columns = measureType.getColumnsNeedDictionary(measureDesc.getFunction());
boolean needReEncode = false;
for (TblColRef col : columns) {
+ //handle the column that all records is null
+ if (sourceCubeSegment.getDictionary(col) == null) {
+ continue;
+ }
+
if (!sourceCubeSegment.getDictionary(col).equals(mergedCubeSegment.getDictionary(col))) {
oldDicts.put(col, sourceCubeSegment.getDictionary(col));
newDicts.put(col, mergedCubeSegment.getDictionary(col));
@@ -249,6 +254,11 @@ public class MergeCuboidMapper extends KylinMapper<Text, Text, Text, Text> {
}
private Boolean checkNeedMerging(TblColRef col) throws IOException {
+ //handle the column that all records is null
+ if (sourceCubeSegment.getDictionary(col) == null) {
+ return false;
+ }
+
Boolean ret = dimensionsNeedDict.get(col);
if (ret != null)
return ret;