Manya0407 commented on code in PR #6746:
URL: https://github.com/apache/hive/pull/6746#discussion_r4014082277
##########
ql/src/test/org/apache/hadoop/hive/ql/optimizer/calcite/stats/TestFilterSelectivityEstimator.java:
##########
@@ -1188,6 +1189,13 @@ private static RexLiteral literalTimestamp(String
timestamp) {
REX_BUILDER.getTypeFactory().createSqlType(SqlTypeName.TIMESTAMP));
}
+ private static RexLiteral literalDate(String date) {
+ GregorianCalendar calendar =
+
GregorianCalendar.from(LocalDate.parse(date).atStartOfDay(ZoneOffset.UTC));
+ return (RexLiteral) REX_BUILDER.makeLiteral(calendar,
+ REX_BUILDER.getTypeFactory().createSqlType(SqlTypeName.DATE), true);
+ }
+
Review Comment:
Done — literalDate() now uses
REX_BUILDER.makeDateLiteral(DateString.fromDaysSinceEpoch(...)) instead of
manually constructing a GregorianCalendar.
--
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]