Repository: kylin Updated Branches: refs/heads/2.0-rc 7b53cad50 -> 94b0c8f0a
minor, pass CI Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/94b0c8f0 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/94b0c8f0 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/94b0c8f0 Branch: refs/heads/2.0-rc Commit: 94b0c8f0a2e412e7b820f63961c9c999158b61b8 Parents: 7b53cad Author: Yang Li <[email protected]> Authored: Sun Dec 27 07:57:13 2015 +0800 Committer: Yang Li <[email protected]> Committed: Sun Dec 27 07:57:13 2015 +0800 ---------------------------------------------------------------------- .../kylin/storage/hbase/cube/v2/CubeSegmentScanner.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/94b0c8f0/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeSegmentScanner.java ---------------------------------------------------------------------- diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeSegmentScanner.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeSegmentScanner.java index 2f78a86..33a1180 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeSegmentScanner.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/cube/v2/CubeSegmentScanner.java @@ -94,14 +94,14 @@ public class CubeSegmentScanner implements IGTScanner { private Pair<ByteArray, ByteArray> getSegmentStartAndEnd(TblColRef tblColRef, int index) { ByteArray start; if (cubeSeg.getDateRangeStart() != Long.MIN_VALUE) { - start = translateTsToString(cubeSeg.getDateRangeStart(), index, 1); + start = encodeTime(cubeSeg.getDateRangeStart(), index, 1); } else { start = new ByteArray(); } ByteArray end; if (cubeSeg.getDateRangeEnd() != Long.MAX_VALUE) { - end = translateTsToString(cubeSeg.getDateRangeEnd(), index, -1); + end = encodeTime(cubeSeg.getDateRangeEnd(), index, -1); } else { end = new ByteArray(); } @@ -109,13 +109,12 @@ public class CubeSegmentScanner implements IGTScanner { } - private ByteArray translateTsToString(long ts, int index, int roundingFlag) { + private ByteArray encodeTime(long ts, int index, int roundingFlag) { String value; DataType partitionColType = info.getColumnType(index); if (partitionColType.isDate()) { value = DateFormat.formatToDateStr(ts); - } else if (partitionColType.isDatetime()) { - //TODO: if partition col is not dict encoded, value's format may differ from expected. Though by default it is not the case + } else if (partitionColType.isDatetime() || partitionColType.isTimestamp()) { value = DateFormat.formatToTimeWithoutMilliStr(ts); } else if (partitionColType.isStringFamily()) { String partitionDateFormat = cubeSeg.getCubeDesc().getModel().getPartitionDesc().getPartitionDateFormat();
