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

Pradeep Kamath updated PIG-1366:
--------------------------------

    Attachment: PIG-1366.patch

Currently in PigStorage the ArrayList backing the Tuple returned in getNext() 
is created in readField(). Under the data conditions explained in the 
description, readField() never gets called and the ArrayList (mProtoTuple) 
remains null causing the eventual NPE. The patch fixes the issue by 
initializing mProtoTuple to a new ArrayList at the beginning of getNext().

> PigStorage's pushProjection implementation results in NPE under certain data 
> conditions
> ---------------------------------------------------------------------------------------
>
>                 Key: PIG-1366
>                 URL: https://issues.apache.org/jira/browse/PIG-1366
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.6.0, 0.7.0
>            Reporter: Pradeep Kamath
>            Assignee: Pradeep Kamath
>             Fix For: 0.7.0
>
>         Attachments: PIG-1366.patch
>
>
> Under the following conditions, a NullPointerException is caused when 
> PigStorage is used:
> If in the script, only the 2nd and 3rd column of the data (say) are used, the 
> PruneColumns optimization passes this information to PigStorage through the 
> pushProjection() method. If the data contains a row with only one column 
> (malformed data due to missing cols in certain rows), PigStorage returns a 
> Tuple backed by a null ArrayList. Subsequent projection operations on this 
> tuple result in the NPE.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to