You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Stamatis Zampetakis (Jira)" <ji...@apache.org> on 2022/05/24 14:01:00 UTC

[jira] [Commented] (HIVE-25268) date_format udf returns wrong results for dates prior to 1900 if the local timezone is other than UTC

    [ https://issues.apache.org/jira/browse/HIVE-25268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17541480#comment-17541480 ] 

Stamatis Zampetakis commented on HIVE-25268:
--------------------------------------------

If I am not wrong this issue strongly depends upon HIVE-25093 in two ways:
 * the problem described here cannot be reproduced unless HIVE-25093 is in place
 * the code changes assume that HIVE-25093 is committed

[~gupta.nikhil0007] can you please confirm that what I wrote above makes sense?

> date_format udf returns wrong results for dates prior to 1900 if the local timezone is other than UTC
> -----------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-25268
>                 URL: https://issues.apache.org/jira/browse/HIVE-25268
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 3.1.0, 3.1.1, 3.1.2, 4.0.0
>            Reporter: Nikhil Gupta
>            Assignee: Nikhil Gupta
>            Priority: Major
>              Labels: pull-request-available, timestamp
>             Fix For: 4.0.0, 4.0.0-alpha-1
>
>          Time Spent: 9h 40m
>  Remaining Estimate: 0h
>
> *Hive 1.2.1*:
> {code:java}
>  select date_format('1400-01-14 01:00:00', 'yyyy-MM-dd HH:mm:ss z');
> +--------------------------+--+
> |           _c0            |
> +--------------------------+--+
> | 1400-01-14 01:00:00 ICT  |
> +--------------------------+--+
> select date_format('1800-01-14 01:00:00', 'yyyy-MM-dd HH:mm:ss z');
> +--------------------------+--+
> |           _c0            |
> +--------------------------+--+
> | 1800-01-14 01:00:00 ICT  |
> +--------------------------+--+
> {code}
> *Hive 3.1, Hive 4.0:*
> {code:java}
> select date_format('1400-01-14 01:00:00', 'yyyy-MM-dd HH:mm:ss z');
> +--------------------------+
> |           _c0            |
> +--------------------------+
> | 1400-01-06 01:17:56 ICT  |
> +--------------------------+
> select date_format('1800-01-14 01:00:00', 'yyyy-MM-dd HH:mm:ss z');
> +--------------------------+
> |           _c0            |
> +--------------------------+
> | 1800-01-14 01:17:56 ICT  |
> +--------------------------+
> {code}
> VM timezone is set to 'Asia/Bangkok'



--
This message was sent by Atlassian Jira
(v8.20.7#820007)