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

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

                Author: ASF GitHub Bot
            Created on: 02/Feb/23 06:27
            Start Date: 02/Feb/23 06:27
    Worklog Time Spent: 10m 
      Work Description: sonarcloud[bot] commented on PR #4008:
URL: https://github.com/apache/hive/pull/4008#issuecomment-1413217123

   Kudos, SonarCloud Quality Gate passed!    [![Quality Gate 
passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png
 'Quality Gate 
passed')](https://sonarcloud.io/dashboard?id=apache_hive&pullRequest=4008)
   
   
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png
 
'Bug')](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4008&resolved=false&types=BUG)
 
[![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png
 
'A')](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4008&resolved=false&types=BUG)
 [0 
Bugs](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4008&resolved=false&types=BUG)
  
   
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png
 
'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4008&resolved=false&types=VULNERABILITY)
 
[![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png
 
'A')](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4008&resolved=false&types=VULNERABILITY)
 [0 
Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4008&resolved=false&types=VULNERABILITY)
  
   [![Security 
Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png
 'Security 
Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=4008&resolved=false&types=SECURITY_HOTSPOT)
 
[![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png
 
'A')](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=4008&resolved=false&types=SECURITY_HOTSPOT)
 [0 Security 
Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_hive&pullRequest=4008&resolved=false&types=SECURITY_HOTSPOT)
  
   [![Code 
Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png
 'Code 
Smell')](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4008&resolved=false&types=CODE_SMELL)
 
[![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png
 
'A')](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4008&resolved=false&types=CODE_SMELL)
 [1 Code 
Smell](https://sonarcloud.io/project/issues?id=apache_hive&pullRequest=4008&resolved=false&types=CODE_SMELL)
   
   [![No Coverage 
information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png
 'No Coverage 
information')](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=4008&metric=coverage&view=list)
 No Coverage information  
   [![No Duplication 
information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/NoDuplicationInfo-16px.png
 'No Duplication 
information')](https://sonarcloud.io/component_measures?id=apache_hive&pullRequest=4008&metric=duplicated_lines_density&view=list)
 No Duplication information
   
   




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

    Worklog Id:     (was: 843086)
    Time Spent: 40m  (was: 0.5h)

> DateTimeFormatterBuilder cannot parse 'UTC+' in Java versions higher than 8
> ---------------------------------------------------------------------------
>
>                 Key: HIVE-27004
>                 URL: https://issues.apache.org/jira/browse/HIVE-27004
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>         Environment: Java version used 
> {code:java}
> openjdk version "11.0.16.1" 2022-08-12 LTS OpenJDK Runtime Environment 
> Corretto-11.0.16.9.1 (build 11.0.16.1+9-LTS) OpenJDK 64-Bit Server VM 
> Corretto-11.0.16.9.1 (build 11.0.16.1+9-LTS, mixed mode{code}
>  
>            Reporter: Anmol Sundaram
>            Assignee: Anmol Sundaram
>            Priority: Minor
>              Labels: pull-request-available
>         Attachments: HIVE-27004.patch
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Some of the unit tests related to _DateTimeFormatter_ were failing in Java 
> versions greater than 8 while working in Java 8.
> Example of a failing Unit Test : 
> _org.apache.hadoop.hive.common.type.TestTimestampTZ#testComparision_
>  
> {code:java}
> java.time.format.DateTimeParseException: Text '2017-04-14 18:00:00 UTC+08:00' 
> could not be parsed, unparsed text found at index 23 at 
> java.base/java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2049)
>  at 
> java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1874)
>  at 
> org.apache.hadoop.hive.common.type.TimestampTZUtil.parse(TimestampTZUtil.java:76)
>  at 
> org.apache.hadoop.hive.common.type.TimestampTZUtil.parse(TimestampTZUtil.java:64)
>  at 
> org.apache.hadoop.hive.common.type.TestTimestampTZ.testComparison(TestTimestampTZ.java:44)
>  at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
> Method){code}
>  
> The {{appendZoneText(TextStyle)}} method of 
> [DateTimeFormatteBuilder|https://github.com/apache/hive/blob/master/common/src/java/org/apache/hadoop/hive/common/type/TimestampTZUtil.java#L82]
>  is not able to parse the {{+}} symbol in {{2017-04-14 18:00:00 UTC+08:00}} 
> when running [the 
> test|https://github.com/apache/hive/blob/master/common/src/test/org/apache/hadoop/hive/common/type/TestTimestampTZ.java#L37]
>  in Java 11 , while it is working fine with Java 8.
> According to the 
> [doc|https://developer.android.com/reference/java/time/format/DateTimeFormatterBuilder#appendZoneText(java.time.format.TextStyle)]
>  , {{appendZoneText(TextStyle)}} should be able to parse {{either the textual 
> zone name, the zone ID or the offset}} and UTC+08:00 should come under offset 
> as per the same 
> [doc|https://developer.android.com/reference/java/time/format/DateTimeFormatterBuilder#appendOffset(java.lang.String,%20java.lang.String)].
> It seems, however, that "UTC" was explicitly removed [when parsed as ZoneText 
> for higher Java 
> versions|https://github.com/openjdk/jdk/commit/5c3a01591c5c945926636fdc9f164d60b5b4f29e?diff=unified#diff-5fcf976db1c06e8f44a8671356d7e34fdfbf5b057baa852e7c3e015c8797c889R4263]
> As a workaround, we can use {{appendZoneOrOffsetId()}} rather than 
> {{appendZoneText().}}
> This ensures the tests are passing for Java 8+ and based on my testing, I 
> didn’t see any regression of the change.
> Sample repro code - jdoodle.com/ia/D5e
>  



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

Reply via email to