You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Koji Noguchi (JIRA)" <ji...@apache.org> on 2016/09/09 20:24:20 UTC

[jira] [Commented] (PIG-5028) Param expansion in macro is confusing

    [ https://issues.apache.org/jira/browse/PIG-5028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15478149#comment-15478149 ] 

Koji Noguchi commented on PIG-5028:
-----------------------------------


{code:title=testmacro.pig}
DEFINE mymacro (A) RETURNS void {
   store $A into 'test${a}${b}${c}';
};
{code}

Run {{pig script1.pig}}
{code:title=script1.pig}
%declare a '1';
%declare b '2';
%declare c '3';
exec testmacro/script2.pig;
{code}

{code:title=script2.pig}
import 'testmacro/testmacro.pig';
%declare b '22';

rel1 = load 'testmacro/input.txt';
mymacro(rel1);    // expecting to expand to test1223 

exec testmacro/script3.pig;
{code}

{code:title=script3.pig}
%declare c '333';
{code}

This expands to {{test122333}} before PIG-4897, 
{{test123}} after PIG-4897, but it should ideally be {{test1223}}.


> Param expansion in macro is confusing
> -------------------------------------
>
>                 Key: PIG-5028
>                 URL: https://issues.apache.org/jira/browse/PIG-5028
>             Project: Pig
>          Issue Type: Bug
>          Components: parser
>            Reporter: Koji Noguchi
>            Assignee: Koji Noguchi
>
> In PIG-3359, we added param expansion inside Macro but it's not clear which param would be picked up when defined multiple times.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)