kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mahong...@apache.org
Subject [3/8] kylin git commit: KYLIN-1698 minor bug fix
Date Thu, 03 Nov 2016 10:39:15 GMT
KYLIN-1698 minor bug fix


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

Branch: refs/heads/yang21-hbase1.x
Commit: 375d4f790ed25d65729cdf2c09e4787cb2c7986f
Parents: 7ef9f2a
Author: Li Yang <liyang@apache.org>
Authored: Thu Nov 3 17:20:42 2016 +0800
Committer: Li Yang <liyang@apache.org>
Committed: Thu Nov 3 17:20:42 2016 +0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/kylin/common/util/DateFormat.java   | 4 ++++
 .../main/java/org/apache/kylin/metadata/model/PartitionDesc.java | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/375d4f79/core-common/src/main/java/org/apache/kylin/common/util/DateFormat.java
----------------------------------------------------------------------
diff --git a/core-common/src/main/java/org/apache/kylin/common/util/DateFormat.java b/core-common/src/main/java/org/apache/kylin/common/util/DateFormat.java
index 2472992..1d70a2d 100644
--- a/core-common/src/main/java/org/apache/kylin/common/util/DateFormat.java
+++ b/core-common/src/main/java/org/apache/kylin/common/util/DateFormat.java
@@ -138,4 +138,8 @@ public class DateFormat {
         }
         return false;
     }
+
+    public static boolean isDatePattern(String ptn) {
+        return COMPACT_DATE_PATTERN.equals(ptn) || DEFAULT_DATE_PATTERN.equals(ptn);
+    }
 }

http://git-wip-us.apache.org/repos/asf/kylin/blob/375d4f79/core-metadata/src/main/java/org/apache/kylin/metadata/model/PartitionDesc.java
----------------------------------------------------------------------
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 6487bfa..11b9bdf 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
@@ -96,7 +96,7 @@ public class PartitionDesc {
             return false;
         
         DataType type = partitionDateColumnRef.getType();
-        return type.isInt();
+        return (type.isInt() || type.isBigInt()) && DateFormat.isDatePattern(partitionDateFormat);
     }
 
     public boolean partitionColumnIsTimeMillis() {
@@ -104,7 +104,7 @@ public class PartitionDesc {
             return false;
         
         DataType type = partitionDateColumnRef.getType();
-        return type.isBigInt();
+        return type.isBigInt() && !DateFormat.isDatePattern(partitionDateFormat);
     }
 
     public boolean isPartitioned() {


Mime
View raw message