You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Olga Natkovich (JIRA)" <ji...@apache.org> on 2011/01/18 03:36:44 UTC

[jira] Assigned: (PIG-1733) java.lang.NumberFormatException as value is automatically detected as int

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

Olga Natkovich reassigned PIG-1733:
-----------------------------------

    Assignee: Laukik Chitnis

> java.lang.NumberFormatException as value is automatically detected as int
> -------------------------------------------------------------------------
>
>                 Key: PIG-1733
>                 URL: https://issues.apache.org/jira/browse/PIG-1733
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.6.0, 0.7.0
>            Reporter: Viraj Bhat
>            Assignee: Laukik Chitnis
>             Fix For: 0.9.0
>
>
> I have Pig script which uses an custom FilterFunc "ANYIN". The parser has made this an "integer" by default. It should be detected as "long" . A cast for the following works.
> {code}B = filter A by ANYIN(id, 21431317276L);{code}
> {code}
> A0 = load '/projects/cookie/20101018/input' using MyLoader as s:map[];
> A = foreach A0 generate s#'cookie' as cookie, s#'rtype' as rtype, s#'id' as id, s#'networkid' as networkid;
> B = filter A by ANYIN(id, 21431317276);
> C = GROUP B BY cookie parallel 10;
> D = foreach C generate group, COUNT(B) as COUNT_FIELD;
> E = filter D BY INRANGE(COUNT_FIELD, 1,1000);
> F = foreach E generate group;
> store F into '/projects/cookie/20101018/output';
> {code}
> Since the parse tries to convert the input to an int we get the following error:
> {quote}
>         at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
>         at java.lang.Integer.parseInt(Integer.java:459)
>         at java.lang.Integer.parseInt(Integer.java:497)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.AtomDatum(QueryParser.java:6593)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.Const(QueryParser.java:6707)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.BaseEvalSpec(QueryParser.java:4868)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.UnaryExpr(QueryParser.java:4774)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.CastExpr(QueryParser.java:4720)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.MultiplicativeExpr(QueryParser.java:4629)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.AdditiveExpr(QueryParser.java:4555)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.InfixExpr(QueryParser.java:4521)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.EvalArgsItem(QueryParser.java:5271)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.EvalArgs(QueryParser.java:5231)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.EvalFuncSpec(QueryParser.java:5049)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.PUnaryCond(QueryParser.java:2075)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.PAndCond(QueryParser.java:1916)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.POrCond(QueryParser.java:1860)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.PCond(QueryParser.java:1826)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.FilterClause(QueryParser.java:1661)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.BaseExpr(QueryParser.java:1368)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.Expr(QueryParser.java:985)
>         at org.apache.pig.impl.logicalLayer.parser.QueryParser.Parse(QueryParser.java:774)
>         at org.apache.pig.impl.logicalLayer.LogicalPlanBuilder.parse(LogicalPlanBuilder.java:63)
>         at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1164)
>         at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1114)
>         at org.apache.pig.PigServer.registerQuery(PigServer.java:425)
>         at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:737)
>         at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:324)
>         at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:162)
>         at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:138)
>         at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:89)
>         at org.apache.pig.Main.main(Main.java:314)
> {quote}
> Viraj

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