'explain -script' does not perform parameter substitution for parameters
specified on commandline
-------------------------------------------------------------------------------------------------
Key: PIG-2100
URL: https://issues.apache.org/jira/browse/PIG-2100
Project: Pig
Issue Type: Bug
Affects Versions: 0.8.1, 0.8.0, 0.9.0
Reporter: Thejas M Nair
Fix For: 0.9.0
{code}
# the file
$ cat t.pig
a = load '$file' as (a0, a1);
dump a;
# parameter on commandline gets substituted
$ java -Xmx500m -classpath pig.jar org.apache.pig.Main -x local -dryrun -p
file=x t.pig
2011-05-31 14:00:24,999 [main] INFO org.apache.pig.Main - Logging error
messages to: /Users/tejas/pig_lpgen_2083/trunk/pig_1306875624997.log
2011-05-31 14:00:25,321 [main] INFO org.apache.pig.Main - Dry run completed.
Substituted pig script is at t.pig.substituted
$ cat t.pig.substituted
a = load 'x' as (a0, a1);
dump a;
# but param in commandline does not get used for explain command, and it fails
java -Xmx500m -classpath pig.jar org.apache.pig.Main -x local -p file=x -e
'explain -script t.pig;'
2011-05-31 14:01:07,217 [main] INFO org.apache.pig.Main - Logging error
messages to: /Users/tejas/pig_lpgen_2083/trunk/pig_1306875667215.log
2011-05-31 14:01:07,364 [main] INFO
org.apache.pig.backend.hadoop.executionengine.HExecutionEngine - Connecting to
hadoop file system at: file:///
2011-05-31 14:01:07,547 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR
2999: Unexpected internal error. Undefined parameter : file
# parameter gets substituted when specified using %declare statement.
cat t2.pig
%declare file x
a = load '$file' as (a0, a1);
dump a;
java -Xmx500m -classpath pig.jar org.apache.pig.Main -x local -p file=x -e
'explain -script t2.pig;'
..
2011-05-31 14:01:44,059 [main] WARN org.apache.pig.tools.grunt.GruntParser -
'dump' statement is ignored while processing 'explain -script' or '-check'
Logical plan is empty.
Physical plan is empty.
Execution plan is empty.
{code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira