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

paco87 edited comment on HIVE-21121 at 2/6/19 3:20 PM:
-------------------------------------------------------

It appears that this issue has something to do with timezones is set (maybe due 
to summer/winter time) if UTC is 0 everything works fine.

I checked two timezones Europe/Warsaw and Europe/Kiove and diffrent dates have 
this problem. 

Anyway when casting date to timestamp should show correct time "00:00:00"

Timezone Europe/Kiev example:

select cast(cast('1900-01-01' as date) as timestamp); 
select cast(cast('1930-06-21' as date) as timestamp); 
select cast(cast('1943-11-06' as date) as timestamp); 
select cast(cast('1981-04-01' as date) as timestamp); 
select cast(cast('1982-04-01' as date) as timestamp); 
select cast(cast('1983-04-01' as date) as timestamp); 
select cast(cast('1984-04-01' as date) as timestamp); 
select cast(cast('1984-09-30' as date) as timestamp); 
select cast(cast('1984-09-30' as date) as timestamp); 
select cast(cast('1985-09-29' as date) as timestamp); 
select cast(cast('1985-09-29' as date) as timestamp); 
select cast(cast('1986-09-28' as date) as timestamp); 
select cast(cast('1986-09-28' as date) as timestamp); 
select cast(cast('1987-09-27' as date) as timestamp); 
select cast(cast('1987-09-27' as date) as timestamp); 
select cast(cast('1988-09-25' as date) as timestamp); 
select cast(cast('1988-09-25' as date) as timestamp); 
select cast(cast('1989-09-24' as date) as timestamp); 
select cast(cast('1989-09-24' as date) as timestamp); 
select cast(cast('1990-07-01' as date) as timestamp); 
select cast(cast('1991-09-29' as date) as timestamp); 
select cast(cast('1991-09-29' as date) as timestamp);


was (Author: paco87):
It appears that this issue has something to do with timezones is set (maybe due 
to summer/winter time) if UTC is 0 everything works fine.

I checked two timezones Europe/Warsaw and Europe/Kiove diffrent dates have this 
problem. 

Anyway when casting date to timestamp should show correct time "00:00:00"

> Cast date to timestamp incorrect interpretation
> -----------------------------------------------
>
>                 Key: HIVE-21121
>                 URL: https://issues.apache.org/jira/browse/HIVE-21121
>             Project: Hive
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.2.1, 2.1.0, 3.0.0
>            Reporter: paco87
>            Priority: Major
>         Attachments: jira_replicate_issue.txt
>
>
> Hive is returning timestamp with current time when casting date to timestamp, 
> where it should be 00:00:00.0 .
> This issue is wired. It seems that this happens only on specific dates: 
> '1900-01-01'.
> +----------------------------++
> |ab|
> +----------------------------++
> |1900-01-01 11:28:46.869|
> |1900-01-01 11:28:46.869|
> |1900-01-01 11:28:46.869|
> |1900-01-01 11:28:46.869|
> |1890-01-01 00:00:00.0|
> |1901-01-01 00:00:00.0|
> |1900-01-01 11:28:46.869|
> +---------------------------++
> -I didin't notice this on any other date.-
>  This might be connected to old issue: HIVE-10488



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to