hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "paco87 (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-21121) Cast date to timestamp incorrect interpretation
Date Fri, 01 Feb 2019 12:19:00 GMT

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

paco87 commented on HIVE-21121:
-------------------------------

I have generated all dates (0001-01-01 to 9999-12-31) and after testing issue appears on
following dates:

1900-01-01 
1919-04-15 
1919-09-16 
1944-10-04 
1957-09-29 
1958-09-28 
1959-10-04 
1960-10-02 
1961-10-01 
1962-09-30 
1963-09-29 
1964-09-27 
1977-09-25 
1978-10-01 
1979-09-30 
1980-09-28 
1981-09-27 
1982-09-26 
1983-09-25 
1984-09-30 
1985-09-29 
1986-09-28 
1987-09-27

You may test without generating any table with this simple queries:

select cast(cast('1900-01-01' as date) as timestamp); 
select cast(cast('1919-04-15' as date) as timestamp); 
select cast(cast('1919-09-16' as date) as timestamp); 
select cast(cast('1944-10-04' as date) as timestamp); 
select cast(cast('1957-09-29' as date) as timestamp); 
select cast(cast('1958-09-28' as date) as timestamp); 
select cast(cast('1959-10-04' as date) as timestamp); 
select cast(cast('1960-10-02' as date) as timestamp); 
select cast(cast('1961-10-01' as date) as timestamp); 
select cast(cast('1962-09-30' as date) as timestamp); 
select cast(cast('1963-09-29' as date) as timestamp); 
select cast(cast('1964-09-27' as date) as timestamp); 
select cast(cast('1977-09-25' as date) as timestamp); 
select cast(cast('1978-10-01' as date) as timestamp); 
select cast(cast('1979-09-30' as date) as timestamp); 
select cast(cast('1980-09-28' as date) as timestamp); 
select cast(cast('1981-09-27' as date) as timestamp); 
select cast(cast('1982-09-26' as date) as timestamp); 
select cast(cast('1983-09-25' 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('1986-09-28' as date) as timestamp); 
select cast(cast('1987-09-27' as date) as timestamp);

 

 

 

> 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
>            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 date: '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)

Mime
View raw message