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 43C497A70 for ; Sat, 10 Dec 2011 01:03:01 +0000 (UTC) Received: (qmail 80850 invoked by uid 500); 10 Dec 2011 01:03:01 -0000 Delivered-To: apmail-pig-dev-archive@pig.apache.org Received: (qmail 80818 invoked by uid 500); 10 Dec 2011 01:03:01 -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 80809 invoked by uid 500); 10 Dec 2011 01:03:01 -0000 Delivered-To: apmail-hadoop-pig-dev@hadoop.apache.org Received: (qmail 80805 invoked by uid 99); 10 Dec 2011 01:03:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Dec 2011 01:03:01 +0000 X-ASF-Spam-Status: No, hits=-2001.2 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; Sat, 10 Dec 2011 01:03:00 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id F20FE109006 for ; Sat, 10 Dec 2011 01:02:39 +0000 (UTC) Date: Sat, 10 Dec 2011 01:02:39 +0000 (UTC) From: "Dmitriy V. Ryaboy (Created) (JIRA)" To: pig-dev@hadoop.apache.org Message-ID: <227697599.61003.1323478959992.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (PIG-2420) FLATTEN of null tuples produces unexpected number of fields MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 FLATTEN of null tuples produces unexpected number of fields ----------------------------------------------------------- Key: PIG-2420 URL: https://issues.apache.org/jira/browse/PIG-2420 Project: Pig Issue Type: Bug Affects Versions: 0.9.0, 0.8.1, 0.8.0, 0.9.1, 0.10, 0.9.2 Reporter: Dmitriy V. Ryaboy Flattening a null tuple results in a single column (with the value null) being produced. That leads to all the columns after the flattened value shifting left by n-1 positions, where n is the number of expected fields in a tuple! Consider: grunt> sh cat tmp/x foo bar a (b,c) d grunt> x = load 'tmp/x' as (a:chararray, b:(b:chararray, c:chararray), d:chararray); grunt> projected = foreach x generate d; grunt> dump projected (bar) (d) grunt> flattened = foreach x generate a, flatten(b) as (b, c), d; grunt> dump flattened (foo,,bar) -- NOTE THREE FIELDS INSTEAD OF EXPECTED 4 (a,b,c,d) grunt> projected = foreach flattened generate d; grunt> dump projected () -- NOTE WRONG VALUE (d) grunt> projected = foreach flattened generate c; () -- NOTE THAT, INCONSISTENTLY, C is NULL! AS IS B. (c) -- 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