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

Ashish Sharma updated HIVE-25458:
---------------------------------
    Description: 
Description - 

unix_timestamp() accept 4 value string/date/timestamp/timestamptz. Out of which 
date/timestamp/timestamptz use DateTimeFormatter.class where as string type use 
SimpleDateTimeformatter.class which cause difference is value.

Example - 
select from_unixtime(unix_timestamp('1800-11-08 01:53:11'));
1800-11-08 01:35:15

select from_unixtime(unix_timestamp(cast('1800-11-08 01:53:11' as timestamp)));
1800-11-08 01:53:11
  

  was:
Description - 

set hive.local.time.zone=Asia/Bangkok;

select from_unixtime(unix_timestamp('1400-11-08 01:53:11'));
Result - 1400-11-17 01:35:15
Expected - 1400-11-08 01:53:11

select from_unixtime(unix_timestamp('1800-11-08 01:53:11'));
Result - 1800-11-08 01:35:15
Expected - 1800-11-08 01:53:11

select from_unixtime(unix_timestamp('1400-11-08 08:00:00 ICT', 'yyyy-MM-dd 
HH:mm:ss z'));
Result 1400-11-17 07:42:04
Expected 1400-11-08 08:00:00 


select from_unixtime(unix_timestamp('1800-11-08 08:00:00 ICT', 'yyyy-MM-dd 
HH:mm:ss z'));
Result - 1800-11-08 07:42:04
Expected - 1800-11-08 08:00:00 








> Make Date/Timestamp parser from LENIENT to STRICT in unix_timestamp()
> ---------------------------------------------------------------------
>
>                 Key: HIVE-25458
>                 URL: https://issues.apache.org/jira/browse/HIVE-25458
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Ashish Sharma
>            Assignee: Ashish Sharma
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> Description - 
> unix_timestamp() accept 4 value string/date/timestamp/timestamptz. Out of 
> which date/timestamp/timestamptz use DateTimeFormatter.class where as string 
> type use SimpleDateTimeformatter.class which cause difference is value.
> Example - 
> select from_unixtime(unix_timestamp('1800-11-08 01:53:11'));
> 1800-11-08 01:35:15
> select from_unixtime(unix_timestamp(cast('1800-11-08 01:53:11' as 
> timestamp)));
> 1800-11-08 01:53:11
>   



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to