This is an automated email from the ASF dual-hosted git repository. shaofengshi pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/kylin.git
The following commit(s) were added to refs/heads/master by this push: new d03df47 Check partitionDesc for null value before use it d03df47 is described below commit d03df473428ea52334fc6d3b9b31a146bcb42c53 Author: Chester Liu <skyline75...@outlook.com> AuthorDate: Wed Mar 4 16:10:25 2020 +0800 Check partitionDesc for null value before use it --- core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java b/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java index 7a44f60..be127c6 100755 --- a/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java +++ b/core-cube/src/main/java/org/apache/kylin/cube/CubeManager.java @@ -64,6 +64,7 @@ import org.apache.kylin.metadata.cachesync.CachedCrudAssist; import org.apache.kylin.metadata.cachesync.CaseInsensitiveStringCache; import org.apache.kylin.metadata.model.DataModelDesc; import org.apache.kylin.metadata.model.JoinDesc; +import org.apache.kylin.metadata.model.PartitionDesc; import org.apache.kylin.metadata.model.SegmentRange; import org.apache.kylin.metadata.model.SegmentRange.TSRange; import org.apache.kylin.metadata.model.SegmentStatusEnum; @@ -719,7 +720,8 @@ public class CubeManager implements IRealizationProvider { checkInputRanges(tsRange, segRange); // fix start/end a bit - if (cubeCopy.getModel().getPartitionDesc().isPartitioned()) { + PartitionDesc partitionDesc = cubeCopy.getModel().getPartitionDesc(); + if (partitionDesc != null && partitionDesc.isPartitioned()) { // if missing start, set it to where last time ends if (tsRange != null && tsRange.start.v == 0) { CubeDesc cubeDesc = cubeCopy.getDescriptor(); @@ -751,8 +753,8 @@ public class CubeManager implements IRealizationProvider { CubeInstance cubeCopy = cube.latestCopyForWrite(); // get a latest copy checkInputRanges(tsRange, segRange); - - if (cubeCopy.getModel().getPartitionDesc().isPartitioned() == false) { + PartitionDesc partitionDesc = cubeCopy.getModel().getPartitionDesc(); + if (partitionDesc == null || partitionDesc.isPartitioned() == false) { // full build tsRange = null; segRange = null;