deniskuzZ commented on code in PR #5241:
URL: https://github.com/apache/hive/pull/5241#discussion_r1595232892
##########
common/src/java/org/apache/hadoop/hive/common/type/TimestampTZUtil.java:
##########
@@ -213,4 +205,26 @@ public static Timestamp convertTimestampToZone(Timestamp
ts, ZoneId fromZone, Zo
public static double convertTimestampTZToDouble(TimestampTZ timestampTZ) {
return timestampTZ.getEpochSecond() + timestampTZ.getNanos() /
DateUtils.NANOS_PER_SEC;
}
+
+ public static Timestamp legacyLeapYearConversions(Timestamp ts, ZoneId
fromZone, ZoneId toZone) {
+ DateTimeFormatter dtf = FORMATTER;
+ Timestamp result = Timestamp.valueOf(
+
dtf.format(dtf.withResolverStyle(ResolverStyle.LENIENT).parse(formatDate(ts,
fromZone, toZone))));
+ result.setNanos(ts.getNanos());
+ return result;
+ }
+
+ private static String formatDate(Timestamp ts, ZoneId fromZone, ZoneId
toZone) {
Review Comment:
what's the purpose of this method if it's used just in
`convertTimestampToZone`
--
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]