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

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

Ofer Mendelevitch created PIG-3442:
--------------------------------------

             Summary: 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


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