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 A0B7B87A9 for ; Fri, 26 Aug 2011 19:49:53 +0000 (UTC) Received: (qmail 460 invoked by uid 500); 26 Aug 2011 19:49:53 -0000 Delivered-To: apmail-pig-dev-archive@pig.apache.org Received: (qmail 391 invoked by uid 500); 26 Aug 2011 19:49:52 -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 382 invoked by uid 500); 26 Aug 2011 19:49:52 -0000 Delivered-To: apmail-hadoop-pig-dev@hadoop.apache.org Received: (qmail 379 invoked by uid 99); 26 Aug 2011 19:49:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Aug 2011 19:49:52 +0000 X-ASF-Spam-Status: No, hits=-2000.5 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, 26 Aug 2011 19:49:50 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id BA881D14C8 for ; Fri, 26 Aug 2011 19:49:30 +0000 (UTC) Date: Fri, 26 Aug 2011 19:49:30 +0000 (UTC) From: "Alan Gates (JIRA)" To: pig-dev@hadoop.apache.org Message-ID: <762514529.18965.1314388170760.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1707548998.18945.1314387809038.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (PIG-2244) Macros cannot be passed relation names 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-2244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13091982#comment-13091982 ] Alan Gates commented on PIG-2244: --------------------------------- Given a script {code} define simple_macro(in_relation, min_gpa, max_age) returns c { b = filter $in_relation by gpa >= $min_gpa and age <= $max_age; $c = foreach b generate age, name; } a = load '/user/pig/tests/data/singlefile/studenttab10k' as (name, age, gpa); x = simple_macro('a', '3.0', '40'); store x into '/user/pig/out/hortonal.1314386707/Macro_DefinitionAndInline_4.out'; {code} (Notice the incorrect quotes around alias a in the invocation of simple_macro.) This produces {code} a = load '/user/pig/tests/data/singlefile/studenttab10k' as (name, age, gpa); macro_simple_macro_b_0 = filter macro_simple_macro_a_0 BY ((gpa >= 3.0) and (age <= 40)); x = foreach macro_simple_macro_b_0 generate age, name; store x INTO '/user/pig/out/hortonal.1314386707/Macro_DefinitionAndInline_4.out'; {code} The alias a gets expanded to macro_simple_macro_a. > Macros cannot be passed relation names > -------------------------------------- > > Key: PIG-2244 > URL: https://issues.apache.org/jira/browse/PIG-2244 > Project: Pig > Issue Type: Bug > Components: parser > Affects Versions: 0.9.0 > Reporter: Alan Gates > Priority: Minor > > If an alias is passed quoted, it gets expanded as if it were an alias in the macro, which leads to a very strange error message. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira