[
https://issues.apache.org/jira/browse/IMPALA-8241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16778150#comment-16778150
]
Attila Jeges commented on IMPALA-8241:
--------------------------------------
[~stiga-huang] [~tarmstrong] There's a difference between how Impala and Hive
interpret "cast(nanosecs as timestamp)". By default Impala returns the result
in UTC, whereas Hive's result is in the local timezone.
E.g..:
select cast(0 as timestamp);
returns "1970-01-01 00:00:00" in Impala and "1970-01-01 01:00:00" in Hive on my
machine (local timezone is set to Europe/Budapest).
As [~tarmstrong] mentioned the '-use_local_tz_for_unix_timestamp_conversions'
flag can make Impala behave like Hive.
> from_utc_timestamp returns inconsistent results with Hive
> ---------------------------------------------------------
>
> Key: IMPALA-8241
> URL: https://issues.apache.org/jira/browse/IMPALA-8241
> Project: IMPALA
> Issue Type: Bug
> Reporter: Quanlong Huang
> Priority: Major
>
> This can be reproduced in both master and 2.x branches.
> {code}
> [localhost:21000] default> select from_utc_timestamp(cast(400000 * 3600.0 as
> timestamp), 'EST');
> Query: select from_utc_timestamp(cast(400000 * 3600.0 as timestamp), 'EST')
> Query submitted at: 2019-02-23 17:27:02 (Coordinator:
> http://impala-jenkins-slave-02:25000)
> Query progress can be monitored at:
> http://impala-jenkins-slave-02:25000/query_plan?query_id=f476c87a904f281:71588a2400000000
> +---------------------------------------------------------------+
> | from_utc_timestamp(cast(400000 * 3600.0 as timestamp), 'est') |
> +---------------------------------------------------------------+
> | 2015-08-19 11:00:00 |
> +---------------------------------------------------------------+
> Fetched 1 row(s) in 0.64s
> {code}
> {code}
> hive> select from_utc_timestamp(cast(400000 * 3600.0 as timestamp), 'EST');
> OK
> 2015-08-19 04:00:00
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]