You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Daniel Dai (Created) (JIRA)" <ji...@apache.org> on 2012/03/15 23:20:40 UTC
[jira] [Created] (PIG-2595) BinCond only works inside parentheses
BinCond only works inside parentheses
-------------------------------------
Key: PIG-2595
URL: https://issues.apache.org/jira/browse/PIG-2595
Project: Pig
Issue Type: Bug
Reporter: Daniel Dai
Fix For: 0.11
Not sure if we have a Jira for this before. This script does not work:
{code}
a = load '/user/pig/tests/data/singlefile/studenttab10k' using PigStorage() as (name, age:int, gpa:double, instate:chararray);
b = foreach a generate name, instate=='true'?gpa:gpa+1;
dump b;
{code}
If we put bincond into parentheses, it works
{code}
a = load '/user/pig/tests/data/singlefile/studenttab10k' using PigStorage() as (name, age:int, gpa:double, instate:chararray);
b = foreach a generate name, (instate=='true'?gpa:gpa+1);
dump b;
{code}
Exception:
ERROR 1200: <file 40.pig, line 2, column 36> mismatched input '==' expecting SEMI_COLON
org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1000: Error during parsing. <file 40.pig, line 2, column 36> mismatched input '==' expecting SEMI_COLON
at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1598)
at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1541)
at org.apache.pig.PigServer.registerQuery(PigServer.java:541)
at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:945)
at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:392)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:190)
at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:166)
at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:84)
at org.apache.pig.Main.run(Main.java:599)
at org.apache.pig.Main.main(Main.java:153)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
Caused by: Failed to parse: <file 40.pig, line 2, column 36> mismatched input '==' expecting SEMI_COLON
at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:226)
at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:168)
at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1590)
... 14 more
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (PIG-2595) BinCond only works inside parentheses
Posted by "Olga Natkovich (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2595?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Olga Natkovich updated PIG-2595:
--------------------------------
Fix Version/s: (was: 0.11)
0.12
Moving to 12 since no work has been done and the ticket is unassigned
> BinCond only works inside parentheses
> -------------------------------------
>
> Key: PIG-2595
> URL: https://issues.apache.org/jira/browse/PIG-2595
> Project: Pig
> Issue Type: Bug
> Reporter: Daniel Dai
> Fix For: 0.12
>
>
> Not sure if we have a Jira for this before. This script does not work:
> {code}
> a = load '/user/pig/tests/data/singlefile/studenttab10k' using PigStorage() as (name, age:int, gpa:double, instate:chararray);
> b = foreach a generate name, instate=='true'?gpa:gpa+1;
> dump b;
> {code}
> If we put bincond into parentheses, it works
> {code}
> a = load '/user/pig/tests/data/singlefile/studenttab10k' using PigStorage() as (name, age:int, gpa:double, instate:chararray);
> b = foreach a generate name, (instate=='true'?gpa:gpa+1);
> dump b;
> {code}
> Exception:
> ERROR 1200: <file 40.pig, line 2, column 36> mismatched input '==' expecting SEMI_COLON
> org.apache.pig.impl.logicalLayer.FrontendException: ERROR 1000: Error during parsing. <file 40.pig, line 2, column 36> mismatched input '==' expecting SEMI_COLON
> at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1598)
> at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1541)
> at org.apache.pig.PigServer.registerQuery(PigServer.java:541)
> at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:945)
> at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:392)
> at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:190)
> at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:166)
> at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:84)
> at org.apache.pig.Main.run(Main.java:599)
> at org.apache.pig.Main.main(Main.java:153)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:156)
> Caused by: Failed to parse: <file 40.pig, line 2, column 36> mismatched input '==' expecting SEMI_COLON
> at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:226)
> at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:168)
> at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1590)
> ... 14 more
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira