hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Lin (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (HIVE-14903) from_utc_time function issue for CET daylight savings
Date Thu, 12 Oct 2017 05:37:00 GMT

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

Eric Lin resolved HIVE-14903.
-----------------------------
    Resolution: Fixed

Tested in CDH5.11, confirm fixed, but not sure which JIRA has the fix in the upstream, will
just resolve it for now.

> from_utc_time function issue for CET daylight savings
> -----------------------------------------------------
>
>                 Key: HIVE-14903
>                 URL: https://issues.apache.org/jira/browse/HIVE-14903
>             Project: Hive
>          Issue Type: Bug
>          Components: Beeline
>    Affects Versions: 2.0.1
>            Reporter: Eric Lin
>            Priority: Minor
>
> Based on https://en.wikipedia.org/wiki/Central_European_Summer_Time, the summer time
is between 1:00 UTC on the last Sunday of March and 1:00 on the last Sunday of October, see
test case below:
> Impala:
> {code}
> select from_utc_timestamp('2016-10-30 00:30:00','CET');
> Query: select from_utc_timestamp('2016-10-30 00:30:00','CET')
> +--------------------------------------------------+
> | from_utc_timestamp('2016-10-30 00:30:00', 'cet') |
> +--------------------------------------------------+
> | 2016-10-30 01:30:00                              |
> +--------------------------------------------------+
> {code}
> Hive:
> {code}
> select from_utc_timestamp('2016-10-30 00:30:00','CET');
> INFO  : OK
> +------------------------+--+
> |          _c0           |
> +------------------------+--+
> | 2016-10-30 01:30:00.0  |
> +------------------------+--+
> {code}
> MySQL:
> {code}
> mysql> SELECT CONVERT_TZ( '2016-10-30 00:30:00', 'UTC', 'CET' );
> +---------------------------------------------------+
> | CONVERT_TZ( '2016-10-30 00:30:00', 'UTC', 'CET' ) |
> +---------------------------------------------------+
> | 2016-10-30 02:30:00                               |
> +---------------------------------------------------+
> {code}
> At 00:30AM UTC, the daylight saving has not finished so the time different should still
be 2 hours rather than 1. MySQL returned correct result
> At 1:30, results are correct:
> Impala:
> {code}
> Query: select from_utc_timestamp('2016-10-30 01:30:00','CET')
> +--------------------------------------------------+
> | from_utc_timestamp('2016-10-30 01:30:00', 'cet') |
> +--------------------------------------------------+
> | 2016-10-30 02:30:00                              |
> +--------------------------------------------------+
> Fetched 1 row(s) in 0.01s
> {code}
> Hive:
> {code}
> +------------------------+--+
> |          _c0           |
> +------------------------+--+
> | 2016-10-30 02:30:00.0  |
> +------------------------+--+
> 1 row selected (0.252 seconds)
> {code}
> MySQL:
> {code}
> mysql> SELECT CONVERT_TZ( '2016-10-30 01:30:00', 'UTC', 'CET' );
> +---------------------------------------------------+
> | CONVERT_TZ( '2016-10-30 01:30:00', 'UTC', 'CET' ) |
> +---------------------------------------------------+
> | 2016-10-30 02:30:00                               |
> +---------------------------------------------------+
> 1 row in set (0.00 sec)
> {code}
> Seems like a bug.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message