From f2fe0e20ce819ef232521c881afce8e54201e585 Mon Sep 17 00:00:00 2001 From: zhengdong Date: Tue, 21 Feb 2017 19:56:48 +0800 Subject: [PATCH] KYLIN-2457 Should copy the latest dictionaries on dimension tables in a batch merge job --- .../kylin/engine/mr/steps/MergeDictionaryStep.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) mode change 100644 => 100755 engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/MergeDictionaryStep.java diff --git a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/MergeDictionaryStep.java b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/MergeDictionaryStep.java old mode 100644 new mode 100755 index 7280d39..36a6f15 --- a/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/MergeDictionaryStep.java +++ b/engine-mr/src/main/java/org/apache/kylin/engine/mr/steps/MergeDictionaryStep.java @@ -94,9 +94,9 @@ public class MergeDictionaryStep extends AbstractExecutable { /** * For the new segment, we need to create dictionaries for it, too. For * those dictionaries on fact table, create it by merging underlying - * dictionaries For those dictionaries on lookup table, just copy it from - * any one of the merging segments, it's guaranteed to be consistent(checked - * in CubeSegmentValidator) + * dictionaries. For those dictionaries on lookup table, just copy them from + * the latest one of the merging segments( https://issues.apache.org/jira/browse/KYLIN-2457), + * which is reasonable under the assumption that lookup tables would be either static or incremental. * * @param cube * @param newSeg @@ -134,9 +134,9 @@ public class MergeDictionaryStep extends AbstractExecutable { } mergeDictionaries(dictMgr, newSeg, dictInfos, col); } - + CubeSegment lastSeg = mergingSegments.get(mergingSegments.size() - 1); for (TblColRef col : colsNeedCopyDict) { - String path = mergingSegments.get(0).getDictResPath(col); + String path = lastSeg.getDictResPath(col); newSeg.putDictResPath(col, path); } } @@ -150,9 +150,9 @@ public class MergeDictionaryStep extends AbstractExecutable { } /** - * make snapshots for the new segment by copying from one of the underlying - * merging segments. it's guaranteed to be consistent(checked in - * CubeSegmentValidator) + * make snapshots for the new segment by copying from the latest one of the underlying + * merging segments. It's guaranteed to be consistent under the assumption that lookup tables + * would be either static or incremental. * * @param cube * @param newSeg -- 2.8.3