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

Koji Noguchi updated PIG-4887:
------------------------------
    Attachment: pig-4887-v01.patch

This is yet another parsing issue which is based on javacc.
In PIG-2597, we're planning to move away from javacc completely and move to 
ANTLR but that hasn't happened for years...

With limited understanding of javacc, here's my patch.
I believe this is happening when PigFileParser's tokenizer matches the longest 
match as comment. Starting from {{/*.jar}} to {{here */}}.

{panel}
register /Users/knoguchi/mydir{color:red}/*.jar;

A = load '$input' as (a1:int);
/* comment here */{color}
store A into '$output';
{panel}

In the patch, treating register as a special case and avoids next word to be 
treated as a comment.

> Parameter substitution skipped with glob on register
> ----------------------------------------------------
>
>                 Key: PIG-4887
>                 URL: https://issues.apache.org/jira/browse/PIG-4887
>             Project: Pig
>          Issue Type: Bug
>            Reporter: Koji Noguchi
>         Attachments: pig-4887-v01.patch
>
>
> For a script with globbing on register followed by multi-line comments, 
> parameter substitution doesn't work.
> {code:title=test.pig}
> register /Users/knoguchi/mydir/*.jar; 
> A = load '$input' as (a1:int);
> /* comment here */
> store A into '$output';
> {code}
> Trying to run this would result in 
> {panel}
> org.apache.pig.backend.executionengine.ExecException: ERROR 2118: Input path 
> does not exist: file:/Users/knoguchi/git/pig/$input
> {panel}
> Running with {{-dryrun}}, we can see that parameter between the globbing and 
> the multi-line style comment is ignored. 
> {noformat}
> % pig -dryrun  -param input=input.txt -param output=output.txt  test.pig
> ...
> 2016-05-05 14:04:34,613 [main] INFO  org.apache.pig.Main - Dry run completed. 
> Substituted pig script is at test.pig.substituted
> ...
> % cat test.pig.substituted
> register /Users/knoguchi/mydir/*.jar;
> A = load '$input' as (a1:int);
> /* comment here */
> store A into 'output.txt';
> %
> {noformat}



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

Reply via email to