pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rohini Palaniswamy (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PIG-4897) Scope of param substitution for run/exec commands
Date Tue, 06 Sep 2016 22:20:20 GMT

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

Rohini Palaniswamy commented on PIG-4897:

I think we should only scope for exec and not run. For run we should overwrite the passed
parameter as declare inside run should be available outside it as per definition from Pig

exec [-param param_name = param_value] [-param_file filename] [script] Execute the Pig Latin
script script. Aliases defined in script are not imported into Grunt. This command is useful
for testing your Pig Latin scripts while inside a Grunt session. You can also run exec without
paramter to only run the Pig statements before exec. The difference is Pig will not combine
them with the rest of the script in execution.
run [-param param_name = param_value] [-param_file filename] script Execute the Pig Latin
script script in the current Grunt shell. Thus all aliases referenced in script are available
to Grunt, and the commands in script are accessible via the shell history. This is another
option for testing Pig Latin scripts while inside a Grunt session.

> 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

View raw message