hadoop-pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Viraj Bhat (JIRA)" <j...@apache.org>
Subject [jira] Commented: (PIG-499) Alias which contains substring "as" causes Parser to throw a syntax error
Date Fri, 17 Oct 2008 03:30:44 GMT

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

Viraj Bhat commented on PIG-499:
--------------------------------

Daniel I observed the same thing, but this creates an inconsistent syntax for {code} foreach
alias { } {code} when alias contains "as" as opposed to when it does not contain...

> Alias which contains substring "as" causes Parser to throw a syntax error
> -------------------------------------------------------------------------
>
>                 Key: PIG-499
>                 URL: https://issues.apache.org/jira/browse/PIG-499
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: types_branch
>         Environment: Hadoop 18
>            Reporter: Viraj Bhat
>            Assignee: Santhosh Srinivasan
>             Fix For: types_branch
>
>
> ---------------------------------------------------------------------------------------
> {code}
> MYDATA = load 'testfile.txt' as (f1, f2, f3, f4, f5);
> MYDATA_PROJECTION = foreach MYDATA generate f3, f5;
> CAST = group MYDATA_PROJECTION by f3;
> RESULT = foreach CAST {
>           MYSORTED = ORDER MYDATA_PROJECTION by f5;
>           generate flatten(MYSORTED);
> }
> dump RESULT;
> {code}
> ---------------------------------------------------------------------------------------
> The above query throws a syntax error 
> java.io.IOException: Encountered "dump" at line 8, column 1.
> Was expecting one of:
>     "parallel" ...
>     ";" ...
>     
>         at org.apache.pig.PigServer.parseQuery(PigServer.java:298)
>         at org.apache.pig.PigServer.registerQuery(PigServer.java:263)
>         at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:439)
>         at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:249)
>         at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:84)
>         at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:64)
>         at org.apache.pig.Main.main(Main.java:306)
> Caused by: org.apache.pig.impl.logicalLayer.parser.ParseException: Encountered "dump"
at line 8, column 1.
> Was expecting one of:
>     "parallel" ...
>     ";" ...
>     
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.generateParseException(QueryParser.java:7763)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.jj_consume_token(QueryParser.java:7640)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.Parse(QueryParser.java:551)
>         at org.apache.pig.impl.logicalLayer.LogicalPlanBuilder.parse(LogicalPlanBuilder.java:60)
>         at org.apache.pig.PigServer.parseQuery(PigServer.java:295)
>         ... 6 more
> ---------------------------------------------------------------------------------------
> But now changing this query to:(changing CAST to CST) makes the query execute successfully.
 
> ---------------------------------------------------------------------------------------
> {code}
> MYDATA = load 'testfile.txt' as (f1, f2, f3, f4, f5);
> MYDATA_PROJECTION = foreach MYDATA generate f3, f5;
> CST = group MYDATA_PROJECTION by f3;
> RESULT = foreach CST {
>           MYSORTED = ORDER MYDATA_PROJECTION by f5;
>           generate flatten(MYSORTED);
> }
> dump RESULT;
> {code}
> ---------------------------------------------------------------------------------------
> I believe this might have been caused due to the patch which resolved issue: https://issues.apache.org/jira/browse/PIG-437

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message