pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Olga Natkovich (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (PIG-2595) BinCond only works inside parentheses
Date Mon, 29 Oct 2012 23:56:12 GMT

     [ 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

Mime
View raw message