[ 
https://issues.apache.org/jira/browse/PIG-4381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Dai updated PIG-4381:
----------------------------
    Attachment: PIG-4381-1.patch

Here is how it happens:
PIG-2122 do parameter substitution line by line in Grunt. However, 
PigFileParser (parameter substitution processor) keep track of multiline define 
statement and skip parameter substitution inside define, so line by line 
approach does not work here.

New patch process the parameter substitution after GruntParser, and we don't do 
parameter substitution line by line, instead, statement by statement. One 
complexity here is GruntParser does not recognize %default and %declare before, 
this is preprocessed by PigFileParser, now it need to accept them and send to 
PigFileParser to process.

>  PIG grunt shell DEFINE commands fails when it spans multiple lines
> -------------------------------------------------------------------
>
>                 Key: PIG-4381
>                 URL: https://issues.apache.org/jira/browse/PIG-4381
>             Project: Pig
>          Issue Type: Bug
>          Components: grunt
>            Reporter: Daniel Dai
>            Assignee: Daniel Dai
>             Fix For: 0.15.0
>
>         Attachments: PIG-4381-1.patch
>
>
> When user executes a define command from the grunt shell and if the command 
> spans across multiple lines the following exception is thrown:
> {code}
> 2014-12-23 11:29:32,637 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 
> 1000: Error during parsing. Lexical error at line 2, column 0. Encountered: 
> <EOF> after : "" 
> Details at logfile: 
> /home/demo/hdp-datascience-demo/demo/pig_1419334148891.log 
> grunt> DEFINE preprocess(year_str, airport_code) returns data 
> 2014-12-23 11:29:43,802 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 
> 1000: Error during parsing. Lexical error at line 2, column 0. Encountered: 
> <EOF> after : "" 
> Details at logfile: 
> /home/demo/hdp-datascience-demo/demo/pig_1419334148891.log 
> {code}
> The same command works fine with a Pig script file.



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

Reply via email to