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

Kokila N updated HIVE-28381:
----------------------------
    Description: 
*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]

 

*A* represents MILLI_OF_DAY.
*JDK8:* Depending on the number of A's given in format, max width is set and 
only those number of digits are considered and if the converted value exceeds 
max width , it will throw error and return null.
*JDK11:* A's max width is hardcoded to 19, so an error is thrown only if it 
exceeds 19 digits.
*Commit:* 
[https://github.com/openjdk/jdk11u-dev/commit/386a77fd91612badbb14edc05fe4142415192b46]

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

> Timestamp behaviour changes for jdk-17
> --------------------------------------
>
>                 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
>
> *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]
>  
> *A* represents MILLI_OF_DAY.
> *JDK8:* Depending on the number of A's given in format, max width is set and 
> only those number of digits are considered and if the converted value exceeds 
> max width , it will throw error and return null.
> *JDK11:* A's max width is hardcoded to 19, so an error is thrown only if it 
> exceeds 19 digits.
> *Commit:* 
> [https://github.com/openjdk/jdk11u-dev/commit/386a77fd91612badbb14edc05fe4142415192b46]
> *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