You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Eric Lin (JIRA)" <ji...@apache.org> on 2016/10/06 10:25:20 UTC

[jira] [Created] (HIVE-14903) from_utc_time function issue for CET daylight savings

Eric Lin created HIVE-14903:
-------------------------------

             Summary: 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}
[host-10-17-101-195.coe.cloudera.com:25003] > 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}
0: jdbc:hive2://host-10-17-101-195.coe.cloude> 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.3.4#6332)