fx19880617 commented on a change in pull request #5653: URL: https://github.com/apache/incubator-pinot/pull/5653#discussion_r449981759
########## File path: pinot-core/src/main/java/org/apache/pinot/core/indexsegment/mutable/MutableSegmentImpl.java ########## @@ -366,12 +368,68 @@ public SegmentPartitionConfig getSegmentPartitionConfig() { } } + /** + * Get min time from the segment, based on the time column, only used by Kafka HLC. + */ + @Deprecated public long getMinTime() { - return _minTime; + Long minTime = extractTimeValue(getMinVal(_timeColumnName)); + if (minTime != null) { + return minTime; + } + return Long.MAX_VALUE; } + /** + * Get max time from the segment, based on the time column, only used by Kafka HLC. + */ + @Deprecated public long getMaxTime() { - return _maxTime; + Long maxTime = extractTimeValue(getMaxVal(_timeColumnName)); + if (maxTime != null) { + return maxTime; + } + return Long.MIN_VALUE; + } + + private Long extractTimeValue(Comparable time) { + if (time != null) { + if (time instanceof Number) { + return ((Number) time).longValue(); + } else { + String stringValue = time.toString(); + if (StringUtils.isNumeric(stringValue)) { Review comment: I keep the same logic as before, this is for legacy HLC usage which assumes time is epoch value. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org