[ 
https://issues.apache.org/jira/browse/HIVE-26233?focusedWorklogId=774533&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-774533
 ]

ASF GitHub Bot logged work on HIVE-26233:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/May/22 12:51
            Start Date: 25/May/22 12:51
    Worklog Time Spent: 10m 
      Work Description: pvary commented on code in PR #3295:
URL: https://github.com/apache/hive/pull/3295#discussion_r881614470


##########
common/src/java/org/apache/hadoop/hive/common/type/Timestamp.java:
##########
@@ -101,6 +101,16 @@ public class Timestamp implements Comparable<Timestamp> {
       // Fractional Part (Optional)
       .optionalStart().appendFraction(ChronoField.NANO_OF_SECOND, 0, 9, 
true).optionalEnd().toFormatter();
 
+  private static final DateTimeFormatter PRINT_LENIENT_FORMATTER = new 
DateTimeFormatterBuilder()
+      // Date and Time Parts
+      .appendValue(YEAR, 4, 10, 
SignStyle.NORMAL).appendLiteral('-').appendValue(MONTH_OF_YEAR, 2, 2, 
SignStyle.NORMAL)
+      .appendLiteral('-').appendValue(DAY_OF_MONTH, 2, 2, SignStyle.NORMAL)
+      .appendLiteral(" ").appendValue(HOUR_OF_DAY, 2, 2, 
SignStyle.NORMAL).appendLiteral(':')
+      .appendValue(MINUTE_OF_HOUR, 2, 2, SignStyle.NORMAL).appendLiteral(':')
+      .appendValue(SECOND_OF_MINUTE, 2, 2, SignStyle.NORMAL)
+      // Fractional Part (Optional)
+      .optionalStart().appendFraction(ChronoField.NANO_OF_SECOND, 0, 9, 
true).optionalEnd().toFormatter();
+

Review Comment:
   Moved to TimestampTZUtil, and renamed





Issue Time Tracking
-------------------

    Worklog Id:     (was: 774533)
    Time Spent: 50m  (was: 40m)

> Problems reading back PARQUET timestamps above 10000 years
> ----------------------------------------------------------
>
>                 Key: HIVE-26233
>                 URL: https://issues.apache.org/jira/browse/HIVE-26233
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Peter Vary
>            Assignee: Peter Vary
>            Priority: Major
>              Labels: backwards-compatibility, pull-request-available, 
> timestamp
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Timestamp values above year 10000 are not supported, but during the migration 
> from Hive2 to Hive3 some might appear because of TZ issues. We should be able 
> to at least read these tables before rewriting the data.
> For this we need to change the Timestamp.PRINT_FORMATTER, so no {{+}} sign is 
> appended to the timestamp if the year exceeds 4 digits.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to