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

Jason Dere commented on HIVE-12502:
-----------------------------------

Looks good, do you mind adding a .q file test with to_date(null)? might be the 
best way to verify it is fixed, if this is your use case.

> to_date UDF cannot accept NULLs of VOID type
> --------------------------------------------
>
>                 Key: HIVE-12502
>                 URL: https://issues.apache.org/jira/browse/HIVE-12502
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 1.0.0
>            Reporter: Aaron Tokhy
>            Assignee: Jason Dere
>            Priority: Trivial
>         Attachments: HIVE-12502-branch-1.patch, HIVE-12502.patch
>
>
> The to_date method behaves differently based off the 'data type' of null 
> passed in.
> hive> select to_date(null);                   
> FAILED: SemanticException [Error 10014]: Line 1:7 Wrong arguments 'TOK_NULL': 
> TO_DATE() only takes STRING/TIMESTAMP/DATEWRITABLE types, got VOID
> hive> select to_date(cast(null as timestamp));
> OK
> NULL
> Time taken: 0.031 seconds, Fetched: 1 row(s)
> This appears to be a regression introduced in HIVE-5731.  The previous 
> version of to_date would not check the type:
> https://github.com/apache/hive/commit/09b6553214d6db5ec7049b88bbe8ff640a7fef72#diff-204f5588c0767cf372a5ca7e3fb964afL56



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to