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

Koji Noguchi commented on PIG-4897:
-----------------------------------

[~daijy] can correct me if I'm mistaken, but to correct the PigMacro behavior, 
we probably need PIG-2597 where we want to move out of javacc 
(PigScriptParser.jj) to ANTLR(QueryParser.g). 

And coming back to non-macro, general param substitution issue with run/exec 
command, we have three options so far.

(1) All global.  (current behavior since 0.12 from PIG-3359)
(2) All private.  (pig-4897-v03.patch).  Only way to transfer params from one 
script to another would be to pass it through commandline params.   run/exec 
-param k=v abc.pig 
(3) Scoped. (pig-4897-v04/05.patch).   

I don't like (1) given the example I've shown in the description and the [first 
comment|https://issues.apache.org/jira/browse/PIG-4897?focusedCommentId=15289823#comment-15289823].

I like (2) the best with no sharing but I'm afraid it may break too many 
scripts that started to depend on (1) behavior.  
(I don't know how many)

(3) is a compromise and hopefully won't break too many scripts who depend on 
(1) behavior but still fixes the two example cases from this jira.

As for fixing the PigMacro, I prefer to create a new jira and revisit once we 
have PIG-2597.

> Scope of param substitution for run/exec commands
> -------------------------------------------------
>
>                 Key: PIG-4897
>                 URL: https://issues.apache.org/jira/browse/PIG-4897
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Koji Noguchi
>            Assignee: Koji Noguchi
>         Attachments: pig-4897-v01-notestyet.patch, pig-4897-v02.patch, 
> pig-4897-v03.patch, pig-4897-v04.patch, pig-4897-v05.patch
>
>
> After PIG-3359, pig param substitution became global in that parameter 
> declared in the pig script called from {{run}} or {{exec}} would live after 
> that script finishes.  
> This created an interesting situation.
> {code:title=test1.pig}
> exec -param output=/tmp/deleteme111 test1_1.pig
> exec -param output=/tmp/deleteme222 test1_1.pig
> {code}
> {code:title=test1_1.pig}
> %default myout '$output.out';
> A = load 'input.txt' as (a0:int);
> store A into '$myout';
> {code}
> Running {{test1.pig}} would try to run two jobs that both tries to write to 
> /tmp/deleteme111 and fail.  (Second param output=/tmp/deleteme222 is ignored.)



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

Reply via email to