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:06 UTC
[kylin] branch 2.5.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.5.x
in repository https://gitbox.apache.org/repos/asf/kylin.git
The following commit(s) were added to refs/heads/2.5.x by this push:
new b76ec1f KYLIN-3689 When the startTime is equal to the endTime in build request, the segment will build all data.
b76ec1f is described below
commit b76ec1f17dbf842a8e79df246f962f3dc24202e7
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 75c90a4..a2127a8 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
@@ -402,6 +402,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 b3bf6cc..2cfa681 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;
}