Mukvin commented on code in PR #2049: URL: https://github.com/apache/kylin/pull/2049#discussion_r1057461579
########## kylin-spark-project/kylin-spark-common/src/main/scala/org/apache/spark/sql/execution/datasource/FilePruner.scala: ########## @@ -366,7 +366,9 @@ class FilePruner(cubeInstance: CubeInstance, val pruned = segDirs.filter { e => { val tsRange = cubeInstance.getSegment(e.segmentName, SegmentStatusEnum.READY).getTSRange - SegFilters(tsRange.startValue, tsRange.endValue, pattern) + // tsRange: 20221219000000_20221219010000、20221219010000_20221219020000, pattern: yyyy-MM-dd + val start = DateFormat.getFormatTimeStamp(tsRange.startValue, pattern) + SegFilters(start, tsRange.endValue, pattern) Review Comment: how about tsRange.endValue? is it same as `start`? ########## core-common/src/main/java/org/apache/kylin/common/util/DateFormat.java: ########## @@ -194,4 +202,18 @@ public static boolean isDatePattern(String ptn) { return COMPACT_DATE_PATTERN.equals(ptn) || YYYYMMDDHH.equals(ptn) || YYYYMMDDHHMM.equals(ptn) || YYYYMMDDHHMMSS.equals(ptn); } + + public static Long getFormatTimeStamp(long time, String pattern) { + try { + if (StringUtils.isNotBlank(pattern)) { + SimpleDateFormat sdf = new SimpleDateFormat(pattern, Locale.getDefault(Locale.Category.FORMAT)); + sdf.setTimeZone(TimeZone.getTimeZone("GMT")); Review Comment: This is hard code for timezone, please reference to org.apache.kylin.common.KylinConfigBase#getTimeZone -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@kylin.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org