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


##########
ql/src/java/org/apache/hadoop/hive/ql/io/parquet/timestamp/NanoTimeUtils.java:
##########
@@ -102,10 +106,22 @@ public static Timestamp getTimestamp(NanoTime nt, ZoneId 
targetZone, boolean leg
 
     JulianDate jDateTime;
     jDateTime = JulianDate.of((double) julianDay);
+    LocalDateTime localDateTime;
+    try {
+      localDateTime = jDateTime.toLocalDateTime();

Review Comment:
   @simhadri-g , how about this
   ````
       JulianDate jDateTime = JulianDate.of((double) julianDay);
       LocalDateTime localDateTime;
       int leapYearAdjustment = 0;
   
       try {
         localDateTime = jDateTime.toLocalDateTime();
       } catch (DateTimeException e) {
         if (e.getMessage().contains(ErrorMsg.NOT_LEAP_YEAR.getMsg()) && 
legacyConversion) {
           localDateTime = 
jDateTime.add(++leapYearDateAdjustment).toLocalDateTime();
         } else {
           throw e;
         }
       }
       .....
       ..... 
       Timestamp ts = Timestamp.ofEpochMilli(calendar.getTimeInMillis(), (int) 
nanos);
       ts = TimestampTZUtil.convertTimestampToZone(ts, ZoneOffset.UTC, 
targetZone, legacyConversion)
         .minusDays(leapYearAdjustment);
   ````
   Timestamp
   ````
     public Timestamp minusDays(long days) {
       localDateTime = localDateTime.minusDays(days);
       return this;
     }
   ````



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