deniskuzZ commented on code in PR #5241:
URL: https://github.com/apache/hive/pull/5241#discussion_r1595544908


##########
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))));

Review Comment:
   omg, got it
   should we rename the 'formatDate' to `formatLegacyDate`?
   also could we move `parse` to the next line



-- 
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]

Reply via email to