kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liy...@apache.org
Subject [07/16] kylin git commit: KYLIN-2010 fix UT
Date Thu, 22 Sep 2016 23:49:51 GMT
KYLIN-2010 fix UT


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/c1fc7238
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/c1fc7238
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/c1fc7238

Branch: refs/heads/KYLIN-2033
Commit: c1fc72386f72b9a86c547e612c6be8093dba4b68
Parents: 8babee8
Author: Yang Li <liyang@apache.org>
Authored: Wed Sep 21 07:16:44 2016 +0800
Committer: Yang Li <liyang@apache.org>
Committed: Wed Sep 21 07:16:44 2016 +0800

----------------------------------------------------------------------
 .../org/apache/kylin/cube/gridtable/SegmentGTStartAndEnd.java    | 2 +-
 .../src/main/java/org/apache/kylin/cube/model/RowKeyColDesc.java | 4 ++--
 .../main/java/org/apache/kylin/metadata/datatype/DataType.java   | 4 ++++
 3 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/c1fc7238/core-cube/src/main/java/org/apache/kylin/cube/gridtable/SegmentGTStartAndEnd.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/gridtable/SegmentGTStartAndEnd.java
b/core-cube/src/main/java/org/apache/kylin/cube/gridtable/SegmentGTStartAndEnd.java
index e31111d..21e01b9 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/gridtable/SegmentGTStartAndEnd.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/gridtable/SegmentGTStartAndEnd.java
@@ -65,7 +65,7 @@ public class SegmentGTStartAndEnd {
         DataType partitionColType = info.getColumnType(index);
         if (partitionColType.isDate()) {
             value = DateFormat.formatToDateStr(ts);
-        } else if (partitionColType.isDatetime() || partitionColType.isTimestamp()) {
+        } else if (partitionColType.isTimeFamily()) {
             value = DateFormat.formatToTimeWithoutMilliStr(ts);
         } else if (partitionColType.isStringFamily()) {
             String partitionDateFormat = segment.getModel().getPartitionDesc().getPartitionDateFormat();

http://git-wip-us.apache.org/repos/asf/kylin/blob/c1fc7238/core-cube/src/main/java/org/apache/kylin/cube/model/RowKeyColDesc.java
----------------------------------------------------------------------
diff --git a/core-cube/src/main/java/org/apache/kylin/cube/model/RowKeyColDesc.java b/core-cube/src/main/java/org/apache/kylin/cube/model/RowKeyColDesc.java
index a1d4440..12c4dfc 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/model/RowKeyColDesc.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/model/RowKeyColDesc.java
@@ -82,13 +82,13 @@ public class RowKeyColDesc {
             if (type.isDate()) {
                 encoding = encodingName = DateDimEnc.ENCODING_NAME;
             }
-            if (type.isTime() || type.isTimestamp() || type.isDatetime()) {
+            if (type.isTimeFamily()) {
                 encoding = encodingName = TimeDimEnc.ENCODING_NAME;
             }
         }
         if (DateDimEnc.ENCODING_NAME.equals(encodingName) && type.isDate() == false)
             throw new IllegalArgumentException(colRef + " type is " + type + " and cannot
apply date encoding");
-        if (TimeDimEnc.ENCODING_NAME.equals(encodingName) && type.isTime() == false)
+        if (TimeDimEnc.ENCODING_NAME.equals(encodingName) && type.isTimeFamily()
== false)
             throw new IllegalArgumentException(colRef + " type is " + type + " and cannot
apply time encoding");
     }
 

http://git-wip-us.apache.org/repos/asf/kylin/blob/c1fc7238/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/DataType.java
----------------------------------------------------------------------
diff --git a/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/DataType.java
b/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/DataType.java
index c981f46..b726c5f 100644
--- a/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/DataType.java
+++ b/core-metadata/src/main/java/org/apache/kylin/metadata/datatype/DataType.java
@@ -212,6 +212,10 @@ public class DataType implements Serializable {
         return DATETIME_FAMILY.contains(name);
     }
 
+    public boolean isTimeFamily() {
+        return DATETIME_FAMILY.contains(name) && !isDate();
+    }
+    
     public boolean isDate() {
         return name.equals("date");
     }


Mime
View raw message