pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Dai (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (PIG-2185) NullPointerException while Accessing Empty Bag in FOREACH { FILTER }
Date Fri, 19 Aug 2011 20:37:29 GMT

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

Daniel Dai updated PIG-2185:
----------------------------

    Attachment: PIG-2185-2.patch

PIG-2185-2.patch address Santhosh's review comment.

> NullPointerException while Accessing Empty Bag in FOREACH { FILTER }
> --------------------------------------------------------------------
>
>                 Key: PIG-2185
>                 URL: https://issues.apache.org/jira/browse/PIG-2185
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.9.0
>            Reporter: Mitesh Singh Jat
>            Assignee: Daniel Dai
>             Fix For: 0.9.1, 0.10
>
>         Attachments: PIG-2185-1.patch, PIG-2185-2.patch
>
>
> On doing FILTERing on empty bag inside FOREACH, NullPointerException occurs.
> The following pig script demonstrates the issue:
> {code:title=empty_bag.pig}
> A = LOAD 'input/empty_bag.in' USING PigStorage() AS (bg:bag{}, ch:chararray);
> B = FOREACH A {
>      x = FILTER bg BY $0 == '12';
>          GENERATE
>          *, 
>          x;
>          };
> DUMP B;
> {code}
> Input is:
> {code:title=input/empty_bag.in}
> {(12)}  a
> {(23)}  b
>         c
> {code}
> Upon execution of Pig Script empty_bag.pig, the NullPointerException comes as shown below:
> {code}
> $ pig -x local empty_bag.pig
> ...
> 2011-07-11 09:52:56,810 [Thread-3] WARN  org.apache.hadoop.mapred.LocalJobRunner - job_local_0001
> java.lang.NullPointerException
>         at
> org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.POProject.getNext(POProject.java:448)
>         at
> org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.processInput(PhysicalOperator.java:290)
>         at
> org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POFilter.getNext(POFilter.java:95)
>         at
> org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.getNext(PhysicalOperator.java:406)
>         at
> org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.POProject.processInputBag(POProject.java:570)
>         at
> org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.PORelationToExprProject.getNext(PORelationToExprProject.java:107)
>         at
> org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.getNext(PhysicalOperator.java:316)
>         at
> org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.POUserFunc.processInput(POUserFunc.java:159)
>         at
> org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.POUserFunc.getNext(POUserFunc.java:184)
>         at
> org.apache.pig.backend.hadoop.executionengine.physicalLayer.expressionOperators.POUserFunc.getNext(POUserFunc.java:258)
>         at
> org.apache.pig.backend.hadoop.executionengine.physicalLayer.PhysicalOperator.getNext(PhysicalOperator.java:316)
>         at
> org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POForEach.processPlan(POForEach.java:332)
>         at
> org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POForEach.getNext(POForEach.java:284)
>         at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigMapBase.runPipeline(PigMapBase.java:261)
>         at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigMapBase.map(PigMapBase.java:256)
>         at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigMapBase.map(PigMapBase.java:58)
>         at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:144)
>         at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:764)
>         at org.apache.hadoop.mapred.MapTask.run(MapTask.java:370)
>         at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:210)
> ...
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message