deniskuzZ commented on code in PR #5637: URL: https://github.com/apache/hive/pull/5637#discussion_r2166986299
########## ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java: ########## @@ -1130,16 +1130,19 @@ private long evaluateComparator(Statistics stats, AnnotateStatsProcCtx aspCtx, E } } } else if (colTypeLowerCase.equals(serdeConstants.INT_TYPE_NAME) || - colTypeLowerCase.equals(serdeConstants.DATE_TYPE_NAME)) { - int value; + colTypeLowerCase.equals(serdeConstants.DATE_TYPE_NAME) || + colTypeLowerCase.equals(serdeConstants.TIMESTAMP_TYPE_NAME)) { + long value; if (colTypeLowerCase.equals(serdeConstants.DATE_TYPE_NAME)) { DateWritable writableVal = new DateWritable(java.sql.Date.valueOf(boundValue)); value = writableVal.getDays(); + } else if (colTypeLowerCase.equals(serdeConstants.TIMESTAMP_TYPE_NAME)) { + TimestampWritableV2 timestampWritable = new TimestampWritableV2(Timestamp.valueOf(boundValue)); + value = timestampWritable.getTimestamp().toEpochSecond(); } else { value = Integer.parseInt(boundValue); } - // Date is an integer internally - int maxValue = cs.getRange().maxValue.intValue(); + long maxValue = cs.getRange().maxValue.longValue(); int minValue = cs.getRange().minValue.intValue(); Review Comment: why would you need double here? if max can't be > long. but I've updated the type for minValue -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org