You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Daniel Dai (JIRA)" <ji...@apache.org> on 2013/08/28 22:38:51 UTC

[jira] [Updated] (PIG-3442) ToDate() null pointer exception when date is NULL

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

Daniel Dai updated PIG-3442:
----------------------------

    Assignee: Hari Sankar Sivarama Subramaniyan
    
> ToDate() null pointer exception when date is NULL
> -------------------------------------------------
>
>                 Key: PIG-3442
>                 URL: https://issues.apache.org/jira/browse/PIG-3442
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Ofer Mendelevitch
>            Assignee: Hari Sankar Sivarama Subramaniyan
>
> When using ToDate(), if the date string is NULL, PIG crashes on NPE (Null pointer exception) instead of gracefully notifying of an invalid argument condition. 
> Here's a reproducible example:
> a = load 'file.txt' using PigStorage(',') as (id:int, date:chararray);
> b = foreach a generate id, date, ToDate(date, 'yyyy-MM-dd');
> dump b;
> where "file.txt" can be like this:
> 1,2013-05-08
> 2,2012-11-02
> 3,
> 4,2013-01-03

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira