You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Carter Shanklin (JIRA)" <ji...@apache.org> on 2017/10/23 17:58:00 UTC

[jira] [Commented] (HIVE-17869) unix_timestamp(string date, string pattern) UDF does not verify date is valid

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

Carter Shanklin commented on HIVE-17869:
----------------------------------------

Seems to be the same as HIVE-17038 which has a PR

[~ashutoshc] can anyone have a look at the PR over there and move that one along?

> unix_timestamp(string date, string pattern) UDF does not verify date is valid
> -----------------------------------------------------------------------------
>
>                 Key: HIVE-17869
>                 URL: https://issues.apache.org/jira/browse/HIVE-17869
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 1.2.1
>            Reporter: Brian Goerlitz
>
> unix_timestamp(string date, string pattern) returns a value in situations which would be expected to return 0 (fail):
> {noformat}
> hive> -- Date does not exist
>     > select unix_timestamp('2017/02/29', 'yyyy/MM/dd');
> OK
> 1488326400
> Time taken: 0.317 seconds, Fetched: 1 row(s)
> hive> -- Date does not exist
>     > select from_unixtime(unix_timestamp('2017/02/29', 'yyyy/MM/dd'));
> OK
> 2017-03-01 00:00:00
> Time taken: 0.28 seconds, Fetched: 1 row(s)
> hive> -- Date in wrong format
>     > select unix_timestamp('2017/02/29', 'MM/dd/yyyy');
> OK
> -55950393600
> Time taken: 0.303 seconds, Fetched: 1 row(s)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)