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 2015/12/22 09:44:44 UTC
[46/50] kylin git commit: KYLIN-1216 Can't parse DateFormat like
'YYYYMMDD' correctly in query
KYLIN-1216 Can't parse DateFormat like 'YYYYMMDD' correctly in query
Signed-off-by: Li, Yang <ya...@ebay.com>
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/e720fa8a
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/e720fa8a
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/e720fa8a
Branch: refs/heads/master
Commit: e720fa8ae6d4a11f5391e99404385bd43155fe93
Parents: b8d7d43
Author: sunyerui <su...@gmail.com>
Authored: Wed Dec 9 17:16:41 2015 +0800
Committer: Li, Yang <ya...@ebay.com>
Committed: Wed Dec 9 17:57:21 2015 +0800
----------------------------------------------------------------------
.../org/apache/kylin/storage/hbase/HBaseKeyRange.java | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/e720fa8a/storage/src/main/java/org/apache/kylin/storage/hbase/HBaseKeyRange.java
----------------------------------------------------------------------
diff --git a/storage/src/main/java/org/apache/kylin/storage/hbase/HBaseKeyRange.java b/storage/src/main/java/org/apache/kylin/storage/hbase/HBaseKeyRange.java
index 7baca90..13ca6b3 100644
--- a/storage/src/main/java/org/apache/kylin/storage/hbase/HBaseKeyRange.java
+++ b/storage/src/main/java/org/apache/kylin/storage/hbase/HBaseKeyRange.java
@@ -36,6 +36,7 @@ import org.apache.kylin.cube.kv.FuzzyKeyEncoder;
import org.apache.kylin.cube.kv.FuzzyMaskEncoder;
import org.apache.kylin.cube.kv.RowConstants;
import org.apache.kylin.cube.model.CubeDesc;
+import org.apache.kylin.metadata.model.PartitionDesc;
import org.apache.kylin.metadata.model.TblColRef;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -122,9 +123,9 @@ public class HBaseKeyRange implements Comparable<HBaseKeyRange> {
stopValues.put(column, dimRange.getEndValue());
fuzzyValues.put(column, dimRange.getEqualValues());
- TblColRef partitionDateColumnRef = cubeSeg.getCubeDesc().getModel().getPartitionDesc().getPartitionDateColumnRef();
- if (column.equals(partitionDateColumnRef)) {
- initPartitionRange(dimRange);
+ PartitionDesc partDesc = cubeSeg.getCubeDesc().getModel().getPartitionDesc();
+ if (column.equals(partDesc.getPartitionDateColumnRef())) {
+ initPartitionRange(dimRange, partDesc.getPartitionDateFormat());
}
}
@@ -143,12 +144,12 @@ public class HBaseKeyRange implements Comparable<HBaseKeyRange> {
this.fuzzyKeys = buildFuzzyKeys(fuzzyValues);
}
- private void initPartitionRange(ColumnValueRange dimRange) {
+ private void initPartitionRange(ColumnValueRange dimRange, String partitionDateFormat) {
if (null != dimRange.getBeginValue()) {
- this.partitionColumnStartDate = DateFormat.stringToDate(dimRange.getBeginValue()).getTime();
+ this.partitionColumnStartDate = DateFormat.stringToDate(dimRange.getBeginValue(), partitionDateFormat).getTime();
}
if (null != dimRange.getEndValue()) {
- this.partitionColumnEndDate = DateFormat.stringToDate(dimRange.getEndValue()).getTime();
+ this.partitionColumnEndDate = DateFormat.stringToDate(dimRange.getEndValue(), partitionDateFormat).getTime();
}
}