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

Sankar Hariappan updated HIVE-25268:
------------------------------------
    Description: 
*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'

  was:
*HDI 3.6 (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}
*HDI 4.0(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'


> date_format udf doesn't work for dates prior to 1900 if the timezone is 
> different from 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
>             Fix For: 4.0.0
>
>          Time Spent: 10m
>  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.3.4#803005)

Reply via email to