[
https://issues.apache.org/jira/browse/HIVE-28894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17943536#comment-17943536
]
Miklos Szurap commented on HIVE-28894:
--------------------------------------
Hive is relying on the JDK provided classes like DateTimeFormatter, which
relies on the underlying "Timezone database" of the JDK. For very old
timestamps and exotic timezones there can be differences, and it can change
over time with the update of the tzdb information as newer rules are included.
See also
https://www.oracle.com/java/technologies/tzdata-versions.html
vs
https://www.azul.com/products/components/ziupdater-time-zone-tool/
Besides trying to update the tzdb, maybe check with 1.8.0_441:
https://www.java.com/en/download/help/release_changes.html
which has a fix around this: "JDK 8u441 contains IANA time zone data 2024b."
> UNIX_TIMESTAMP returns different value for some JDKs
> ----------------------------------------------------
>
> Key: HIVE-28894
> URL: https://issues.apache.org/jira/browse/HIVE-28894
> Project: Hive
> Issue Type: Bug
> Environment: Apache Maven 3.6.3
> (cecedd343002696d0abb50b32b541b8a6ba2883f)
> Maven home: /opt/maven/apache-maven-3.6.3
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "6.8.0-57-generic", arch: "amd64", family: "unix"
> Reporter: Stamatis Zampetakis
> Priority: Major
>
> The following query returns different timestamp values depending on which JDK
> version is used.
> {code:sql}
> select unix_timestamp('1400-11-08 08:00:00 ICT', 'yyyy-MM-dd HH:mm:ss z')
> {code}
> Java version: 1.8.0_421, vendor: Oracle Corporation, runtime:
> /opt/jdks/jdk1.8.0_421/jre
> {noformat}
> -17960569590
> {noformat}
> Java version: 1.8.0_262, vendor: Azul Systems, Inc., runtime:
> /opt/jdks/zulu8.48.0.51-ca-jdk8.0.262-linux_x64/jre
> {noformat}
> -17960569600
> {noformat}
> The problem was observed while running udf5.q file where locally some results
> appeared shifted by 10 seconds.
> To reproduce the problem it suffices to download the aforementioned JDKs set
> the JAVA_HOME variable to point to the JDK and run the udf5.q file.
> {noformat}
> export JAVA_HOME=/opt/jdks/zulu8.48.0.51-ca-jdk8.0.262-linux_x64/
> mvn test -Dtest=TestMiniLlapLocalCliDriver -Dqfile=udf5.q
> -Dtest.output.overwrite
> export JAVA_HOME=/opt/jdks/jdk1.8.0_421
> mvn test -Dtest=TestMiniLlapLocalCliDriver -Dqfile=udf5.q
> -Dtest.output.overwrite
> {noformat}
> Note that the zulu distribution is the one that is currently used in Jenkins
> CI to run the tests.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)