deniskuzZ commented on code in PR #5637:
URL: https://github.com/apache/hive/pull/5637#discussion_r2164282734
##########
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:
minRange fits the int type
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]