[ 
https://issues.apache.org/jira/browse/HIVE-28381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kokila N resolved HIVE-28381.
-----------------------------
    Fix Version/s: NA
       Resolution: Duplicate

JIRA: HIVE-26473 

PR: [PR-5404|https://github.com/apache/hive/pull/5404] 

Commit : 
[https://github.com/apache/hive/pull/5404/commits/946967270b551000bddbae54f7e391738edebb17]
 

> JDK17: Change in behaviour of DAY_OF_YEAR in timestamp 
> -------------------------------------------------------
>
>                 Key: HIVE-28381
>                 URL: https://issues.apache.org/jira/browse/HIVE-28381
>             Project: Hive
>          Issue Type: Sub-task
>            Reporter: Akshat Mathur
>            Assignee: Kokila N
>            Priority: Major
>             Fix For: NA
>
>
> *Issue:*
> {code:java}
> Field DayOfYear cannot be printed as the value 202 exceeds the maximum print 
> width of 2;{code}
> *RCA:*
> Two DATETIME format changes in JDK11:{*}D{*} represents DAY_OF_YEAR as in it 
> counts days from 1-366 which requires DDD in format (dd represents 
> DAY_OF_MONTH -> counts 1-31).
> *JDK8:* If given format is DD(width=2) but the day is actually with 3 
> width(above 100) in the input value then this will trigger error that width 
> exceeds 2 and returns null.
> *JDK11:* If given format is DD or DDD then max width is set to 3(hardcoded) 
> so it considers days with 2 and 3 digits as valid and returns the value which 
> corresponds to the day in the year.
> *Commit:* 
> [https://github.com/openjdk/jdk11u-dev/commit/4900a8320308f0b55344644a599c4d86afec72d2]
> *Solution:*
> Changing the value in test cases should be fine for these tests in 
> *TestGenericUDFDateFormatEvaluate.java and 
> TestGenericUDFFromUnixTimeEvaluate.java* as the JDK behaviour has changed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to