You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2018/11/20 01:37:21 UTC

[kylin] branch 2.4.x updated: KYLIN-3689 When the startTime is equal to the endTime in build request, the segment will build all data.

This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a commit to branch 2.4.x
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/2.4.x by this push:
     new 34bc876  KYLIN-3689 When the startTime is equal to the endTime in build request, the segment will build all data.
34bc876 is described below

commit 34bc87638a66da2b42822ccc66ca3789165c4607
Author: 贺红涛 <he...@lianjia.com>
AuthorDate: Wed Nov 14 22:45:11 2018 +0800

    KYLIN-3689 When the startTime is equal to the endTime in build request, the segment will build all data.
---
 core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java      | 6 ++++++
 .../main/java/org/apache/kylin/metadata/model/PartitionDesc.java    | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java b/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java
index d49c273..802db17 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/CubeSegment.java
@@ -398,6 +398,12 @@ public class CubeSegment implements IBuildable, ISegment, Serializable {
 
     @Override
     public void validate() throws IllegalStateException {
+        if (cubeInstance.getDescriptor().getModel().getPartitionDesc().isPartitioned()) {
+            if (!isOffsetCube() && dateRangeStart >= dateRangeEnd)
+                throw new IllegalStateException("Invalid segment, dateRangeStart(" + dateRangeStart + ") must be smaller than dateRangeEnd(" + dateRangeEnd + ") in segment " + this);
+            if (isOffsetCube() && sourceOffsetStart >= sourceOffsetEnd)
+                throw new IllegalStateException("Invalid segment, sourceOffsetStart(" + sourceOffsetStart + ") must be smaller than sourceOffsetEnd(" + sourceOffsetEnd + ") in segment " + this);
+        }
     }
 
     public String getProject() {
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/model/PartitionDesc.java b/core-metadata/src/main/java/org/apache/kylin/metadata/model/PartitionDesc.java
index 2f23bdc..dc2e7b4 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/model/PartitionDesc.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/model/PartitionDesc.java
@@ -239,7 +239,7 @@ public class PartitionDesc implements Serializable {
             String partitionColumnName = partitionColumn.getIdentity();
 
             if (endExclusive <= startInclusive) {
-                builder.append("1=1");
+                builder.append("1=0");
                 return;
             }