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

Vivek Padmanabhan commented on PIG-2127:
----------------------------------------

I think this issue is still present with PigStorage -schema option,


{code}
a = load '2127_withschema' using PigStorage(',','-schema');
b = foreach a generate f1,f2,f3,f4;
dump b;
{code}

input
{code}
d,e,4,1
a,b,1,2
c,b
d,e,4,1
{code}

The above given script and input produces the below exception;
java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
        at java.util.ArrayList.RangeCheck(ArrayList.java:547)
        at java.util.ArrayList.get(ArrayList.java:322)
        at org.apache.pig.data.DefaultTuple.get(DefaultTuple.java:156)
        at org.apache.pig.builtin.PigStorage.applySchema(PigStorage.java:282)
        at org.apache.pig.builtin.PigStorage.getNext(PigStorage.java:246)
        at 
org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigRecordReader.nextKeyValue(PigRecordReader.java:194)
        at 
org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:532)
        at 
org.apache.hadoop.mapreduce.MapContext.nextKeyValue(MapContext.java:67)
        at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:143)
        
                
> PigStorageSchema need to deal with missing field
> ------------------------------------------------
>
>                 Key: PIG-2127
>                 URL: https://issues.apache.org/jira/browse/PIG-2127
>             Project: Pig
>          Issue Type: Bug
>          Components: impl
>    Affects Versions: 0.10.0
>            Reporter: Daniel Dai
>             Fix For: 0.10.0
>
>
> Currently, if data contains fewer columns than the schema, PigStorageSchema 
> will throw IndexOutOfBound exception (PigStorageSchema:97). We should padding 
> null in this case as we did in PigStorage.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to