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


##########
common/src/java/org/apache/hadoop/hive/common/type/TimestampTZUtil.java:
##########
@@ -193,7 +196,18 @@ public static Timestamp convertTimestampToZone(Timestamp 
ts, ZoneId fromZone, Zo
         java.util.Date date = formatter.parse(ts.format(TIMESTAMP_FORMATTER));
         // Set the formatter to use a different timezone
         formatter.setTimeZone(TimeZone.getTimeZone(toZone));
-        Timestamp result = Timestamp.valueOf(formatter.format(date));
+        Timestamp result;
+        try {
+          result = Timestamp.valueOf(formatter.format(date));
+        } catch (IllegalArgumentException ex) {
+          if (ex.getCause().getMessage().contains(NOT_LEAP_YEAR)) {
+            int leapYearDateAdjustment = ts.getMonth() == 
Month.MARCH.getValue() ? 2 : -2;

Review Comment:
   1 and -1 here are ok



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