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 5688AF721 for ; Fri, 5 Apr 2013 21:49:19 +0000 (UTC) Received: (qmail 87483 invoked by uid 500); 5 Apr 2013 21:49:19 -0000 Delivered-To: apmail-pig-dev-archive@pig.apache.org Received: (qmail 87442 invoked by uid 500); 5 Apr 2013 21:49:19 -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 87431 invoked by uid 500); 5 Apr 2013 21:49:18 -0000 Delivered-To: apmail-hadoop-pig-dev@hadoop.apache.org Received: (qmail 87428 invoked by uid 99); 5 Apr 2013 21:49:18 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Apr 2013 21:49:18 +0000 Date: Fri, 5 Apr 2013 21:49:18 +0000 (UTC) From: "Daniel Dai (JIRA)" To: pig-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (PIG-3060) FLATTEN in nested foreach fails when the input contains an empty bag 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-3060?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel Dai updated PIG-3060: ---------------------------- Attachment: PIG-3060-1.patch There could be several fixes. The most proper fix I feel is to fix the way we flatten a bag. If we run out of a bag, return EOP instead of NULL. Running tests. > FLATTEN in nested foreach fails when the input contains an empty bag > -------------------------------------------------------------------- > > Key: PIG-3060 > URL: https://issues.apache.org/jira/browse/PIG-3060 > Project: Pig > Issue Type: Bug > Components: impl > Affects Versions: 0.10.0 > Reporter: Youngwook Kim > Attachments: PIG-3060-1.patch > > > FLATTEN inside a foreach statement produces wrong results, if the input contains an empty bag. > {code} > A = load 'flatten.txt' as (a0:int, a1:bag{(t:chararray)}); > B = group A by a0; > C = foreach B { > c1 = foreach A generate FLATTEN(a1); > generate COUNT(c1); > }; > {code} > The easy workaround is to filter out empty bags. -- 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