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

Grant Ingersoll commented on PIG-2122:
--------------------------------------

Seems to me one of the major use cases of the Grunt shell is to test your 
scripts line by line.  If you don't have parameter substitution, then you have 
to futz around with hand editing out the substitutions to run it in Grunt, and 
then add it back in before you submit it to run in file mode.  

The other use case is, the documentation doesn't work!  I would bet that many 
people simply try out what is on the website as examples, so when things like 
declare, etc. as copy and pasted from the website don't work, they lose 
confidence in the tool.

> Parameter Substitution doesn't work in the Grunt shell
> ------------------------------------------------------
>
>                 Key: PIG-2122
>                 URL: https://issues.apache.org/jira/browse/PIG-2122
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.8.0, 0.8.1
>            Reporter: Grant Ingersoll
>            Priority: Minor
>
> Simple param substitution and things like %declare (as copied out of the 
> docs) don't work in the grunt shell.
> #Start Pig with: Start Pig with: bin/pig -x local -p time=FOO
> {quote}
> foo = LOAD '/user/grant/foo.txt' AS (a:chararray, b:chararray, c:chararray);
> Y = foreach foo generate *, '$time';
> dump Y;
> {quote}
> Output:
> {quote}
> 2011-06-13 20:22:24,197 [main] INFO  
> org.apache.pig.backend.hadoop.executionengine.util.MapRedUtil - Total input 
> paths to process : 1
> (1 2 3,,,$time)
> (4 5 6,,,$time)
> {quote}
> Same script, stored in junk.pig, run as: bin/pig -x local -p time=FOO junk.pig
> {quote}
> 2011-06-13 20:23:38,864 [main] INFO  
> org.apache.pig.backend.hadoop.executionengine.util.MapRedUtil - Total input 
> paths to process : 1
> (1 2 3,,,FOO)
> (4 5 6,,,FOO)
> {quote}
> Also, things like don't work (nor does %declare):
> {quote}
> grunt> %default DATE '20090101';    
> 2011-06-13 20:18:19,943 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 
> 1000: Error during parsing. Encountered " <PATH> "%default "" at line 1, 
> column 1.
> Was expecting one of:
>     <EOF> 
>     "cat" ...
>     "fs" ...
>     "sh" ...
>     "cd" ...
>     "cp" ...
>     "copyFromLocal" ...
>     "copyToLocal" ...
>     "dump" ...
>     "describe" ...
>     "aliases" ...
>     "explain" ...
>     "help" ...
>     "kill" ...
>     "ls" ...
>     "mv" ...
>     "mkdir" ...
>     "pwd" ...
>     "quit" ...
>     "register" ...
>     "rm" ...
>     "rmf" ...
>     "set" ...
>     "illustrate" ...
>     "run" ...
>     "exec" ...
>     "scriptDone" ...
>     "" ...
>     <EOL> ...
>     ";" ...
>     
> Details at logfile: 
> /Users/grant.ingersoll/projects/apache/pig/release-0.8.1/pig_1308002917912.log
> {quote}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to