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

Ryan Blue commented on HIVE-12196:
----------------------------------

Thanks, it sounds like there are actually two problems. First, the one that you 
fixed which is causing the NPE. Second, whether this behavior should be caught 
and result in an exception or NULL.

I don't see why it shouldn't be the case that the timestamp in the first query 
isn't converted in the compiler but the second is. I guess it could be that the 
type information for that function isn't available, so the coercion actually 
takes place at runtime when you don't want to fail an entire query for a single 
value (even if it is a literal value in this case). I think that could be 
fixed, but I also have no idea how much work it would be so I'll defer to 
someone with more Hive knowledge.

> NPE when converting bad timestamp value
> ---------------------------------------
>
>                 Key: HIVE-12196
>                 URL: https://issues.apache.org/jira/browse/HIVE-12196
>             Project: Hive
>          Issue Type: Sub-task
>          Components: Hive
>    Affects Versions: 1.1.1
>            Reporter: Ryan Blue
>            Assignee: Aihua Xu
>         Attachments: HIVE-12196.patch
>
>
> When I convert a timestamp value that is slightly wrong, the result is a NPE. 
> Other queries correctly reject the timestamp:
> {code}
> hive> select from_utc_timestamp('2015-04-11-12:24:34.535', 'UTC');
> FAILED: NullPointerException null
> hive> select TIMESTAMP '2015-04-11-12:24:34.535';
> FAILED: SemanticException Unable to convert time literal 
> '2015-04-11-12:24:34.535' to time value.
> {code}



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

Reply via email to