Return-Path: X-Original-To: apmail-pig-dev-archive@www.apache.org Delivered-To: apmail-pig-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A4B1777AC for ; Fri, 19 Aug 2011 20:13:52 +0000 (UTC) Received: (qmail 75801 invoked by uid 500); 19 Aug 2011 20:13:52 -0000 Delivered-To: apmail-pig-dev-archive@pig.apache.org Received: (qmail 75577 invoked by uid 500); 19 Aug 2011 20:13:51 -0000 Mailing-List: contact dev-help@pig.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pig.apache.org Delivered-To: mailing list dev@pig.apache.org Received: (qmail 75569 invoked by uid 500); 19 Aug 2011 20:13:51 -0000 Delivered-To: apmail-hadoop-pig-dev@hadoop.apache.org Received: (qmail 75565 invoked by uid 99); 19 Aug 2011 20:13:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Aug 2011 20:13:51 +0000 X-ASF-Spam-Status: No, hits=-2001.1 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Aug 2011 20:13:49 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 6B191C5043 for ; Fri, 19 Aug 2011 20:13:29 +0000 (UTC) Date: Fri, 19 Aug 2011 20:13:29 +0000 (UTC) From: "jiraposter@reviews.apache.org (JIRA)" To: pig-dev@hadoop.apache.org Message-ID: <1641322789.54151.1313784809435.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1696144209.10982.1311247143614.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (PIG-2185) NullPointerException while Accessing Empty Bag in FOREACH { FILTER } MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/PIG-2185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13087933#comment-13087933 ] jiraposter@reviews.apache.org commented on PIG-2185: ---------------------------------------------------- ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/1600/#review1560 ----------------------------------------------------------- trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POProject.java The variable should be declared after the null check. If the null check is false then the variable is never used. - Santhosh On 2011-08-19 19:54:30, Daniel Dai wrote: bq. bq. ----------------------------------------------------------- bq. This is an automatically generated e-mail. To reply, visit: bq. https://reviews.apache.org/r/1600/ bq. ----------------------------------------------------------- bq. bq. (Updated 2011-08-19 19:54:30) bq. bq. bq. Review request for pig and thejas. bq. bq. bq. Summary bq. ------- bq. bq. See PIG-2185 bq. bq. bq. This addresses bug PIG-2185. bq. https://issues.apache.org/jira/browse/PIG-2185 bq. bq. bq. Diffs bq. ----- bq. bq. trunk/src/org/apache/pig/backend/hadoop/executionengine/physicalLayer/expressionOperators/POProject.java 1159433 bq. trunk/test/org/apache/pig/test/TestEvalPipeline2.java 1159433 bq. bq. Diff: https://reviews.apache.org/r/1600/diff bq. bq. bq. Testing bq. ------- bq. bq. test-patch pass: bq. [exec] +1 overall. bq. [exec] bq. [exec] +1 @author. The patch does not contain any @author tags. bq. [exec] bq. [exec] +1 tests included. The patch appears to include 3 new or modified tests. bq. [exec] bq. [exec] +1 javadoc. The javadoc tool did not generate any warning messages. bq. [exec] bq. [exec] +1 javac. The applied patch does not increase the total number of javac compiler warnings. bq. [exec] bq. [exec] +1 findbugs. The patch does not introduce any new Findbugs warnings. bq. [exec] bq. [exec] +1 release audit. The applied patch does not increase the total number of release audit warnings. bq. bq. Unit tests pass. bq. bq. bq. Thanks, bq. bq. Daniel bq. bq. > 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 > > > 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