pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Dai (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (PIG-3772) Syntax error when casting an inner schema of a bag and line break involved
Date Mon, 21 Apr 2014 18:32:16 GMT

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

Daniel Dai updated PIG-3772:
----------------------------

      Resolution: Fixed
    Hadoop Flags: Reviewed
          Status: Resolved  (was: Patch Available)

Patch committed to trunk. Thanks Sergey!

> Syntax error when casting an inner schema of a bag and line break involved
> --------------------------------------------------------------------------
>
>                 Key: PIG-3772
>                 URL: https://issues.apache.org/jira/browse/PIG-3772
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.11.1
>            Reporter: Haishan Liu
>            Assignee: Sergey Svinarchuk
>             Fix For: 0.13.0
>
>         Attachments: PIG-3772-2.patch, PIG-3772-3.patch, PIG-3772.patch
>
>
> Hi,
> The following script fails with syntax error
> {code}
> A = load 'data' as (a:{(x:chararray, y:float)}, b:chararray);
> B = foreach A generate
>     b,
>     (bag{tuple(long)}) a.x as ax:{(x:long)};
> {code}
> where the cast statement is on its own line.
> The script fails with the following exception:
> {code}
> 19-02-2014 17:30:22 PST bug_script ERROR - org.apache.pig.impl.logicalLayer.FrontendException:
ERROR 1000: Error during parsing.   Syntax error, unexpected symbol at or near 'bag'
> 19-02-2014 17:30:22 PST bug_script ERROR - 	at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1607)
> 19-02-2014 17:30:22 PST bug_script ERROR - 	at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1546)
> 19-02-2014 17:30:22 PST bug_script ERROR - 	at org.apache.pig.PigServer.registerQuery(PigServer.java:516)
> 19-02-2014 17:30:22 PST bug_script ERROR - 	at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:988)
> 19-02-2014 17:30:22 PST bug_script ERROR - 	at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:412)
> 19-02-2014 17:30:22 PST bug_script ERROR - 	at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:194)
> 19-02-2014 17:30:22 PST bug_script ERROR - 	at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:170)
> 19-02-2014 17:30:22 PST bug_script ERROR - 	at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:84)
> 19-02-2014 17:30:22 PST bug_script ERROR - 	at org.apache.pig.Main.run(Main.java:604)
> 19-02-2014 17:30:22 PST bug_script ERROR - 	at org.apache.pig.PigRunner.run(PigRunner.java:49)
> 19-02-2014 17:30:22 PST bug_script ERROR - 	at azkaban.jobtype.HadoopSecurePigWrapper.runPigJob(HadoopSecurePigWrapper.java:116)
> 19-02-2014 17:30:22 PST bug_script ERROR - 	at azkaban.jobtype.HadoopSecurePigWrapper$1.run(HadoopSecurePigWrapper.java:106)
> 19-02-2014 17:30:22 PST bug_script ERROR - 	at azkaban.jobtype.HadoopSecurePigWrapper$1.run(HadoopSecurePigWrapper.java:103)
> 19-02-2014 17:30:22 PST bug_script ERROR - 	at java.security.AccessController.doPrivileged(Native
Method)
> 19-02-2014 17:30:22 PST bug_script ERROR - 	at javax.security.auth.Subject.doAs(Subject.java:396)
> 19-02-2014 17:30:22 PST bug_script ERROR - 	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190)
> 19-02-2014 17:30:22 PST bug_script ERROR - 	at azkaban.jobtype.HadoopSecurePigWrapper.main(HadoopSecurePigWrapper.java:103)
> 19-02-2014 17:30:22 PST bug_script ERROR - Caused by: Failed to parse:   Syntax error,
unexpected symbol at or near 'bag'
> 19-02-2014 17:30:22 PST bug_script ERROR - 	at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:235)
> 19-02-2014 17:30:22 PST bug_script ERROR - 	at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:177)
> 19-02-2014 17:30:22 PST bug_script ERROR - 	at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1599)
> 19-02-2014 17:30:22 PST bug_script ERROR - 	... 16 more
> {code}
> The script succeeds if the foreach statement is written in one line:
> {code}
> B = foreach A generate b, (bag{tuple(long)}) a.x as ax:{(x:long)};
> {code}
> This problem happens only in batch mode.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message