pig-user  

IndexOutOfBoundsException

Eric Zhang
Tue, 29 Apr 2008 15:29:18 -0700

I got following IndexoutOfBoundsException when running pig script on kryptonite cluster (see bottom for the exception message). it looks like it happened when parsing this pig script:

trust = FOREACH (COGROUP tempTrust BY $0, seedHostsWithTrust BY $0 PARALLEL 200) GENERATE group as host, flatten((IsEmpty(seedHostsWithTrust) ? 0 : seedHostsWithTrust.$1) + (IsEmpty(tempTrust3) ? 0 : tempTrust3.$1)) as value PARALLEL 200;

The line tries to add up trust values from two tables for the same host. The tempTrust and seedHostsWithTrust tables are computed and stored before this statement. Strangely, if i load the two tables directly from stored copy before executing the statement, it runs fine.

This is the pig source code which throws the exception:

   public TupleSchema outputSchema() {
       return opTable.get(getInputs().get(0)).outputSchema();
   }

It seems like the exception is thrown from "getInputs().get(0)", but the index is 0 instead of 1.
Can anybody give me the hint why i got  this exception?


2008-04-29 21:30:44,175 [main] INFO org.apache.pig.backend.hadoop.executionengine.mapreduceExec.MapReduceLauncher - Pig progress = 99% 2008-04-29 21:30:48,184 [main] INFO org.apache.pig.backend.hadoop.executionengine.mapreduceExec.MapReduceLauncher - Pig progress = 99% 2008-04-29 21:30:52,193 [main] INFO org.apache.pig.backend.hadoop.executionengine.mapreduceExec.MapReduceLauncher - Pig progress = 100% 2008-04-29 21:30:52,229 [main] ERROR org.apache.pig.tools.grunt.Grunt - java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
       at java.util.ArrayList.RangeCheck(ArrayList.java:547)
       at java.util.ArrayList.get(ArrayList.java:322)
at org.apache.pig.impl.logicalLayer.LOSplitOutput.outputSchema(LOSplitOutput.java:46) at org.apache.pig.impl.logicalLayer.parser.QueryParser.GroupItem(QueryParser.java:1090) at org.apache.pig.impl.logicalLayer.parser.QueryParser.CogroupClause(QueryParser.java:1025) at org.apache.pig.impl.logicalLayer.parser.QueryParser.BaseExpr(QueryParser.java:548) at org.apache.pig.impl.logicalLayer.parser.QueryParser.NestedExpr(QueryParser.java:430) at org.apache.pig.impl.logicalLayer.parser.QueryParser.ForEachClause(QueryParser.java:1393) at org.apache.pig.impl.logicalLayer.parser.QueryParser.BaseExpr(QueryParser.java:577) at org.apache.pig.impl.logicalLayer.parser.QueryParser.Expr(QueryParser.java:378) at org.apache.pig.impl.logicalLayer.parser.QueryParser.Parse(QueryParser.java:228) at org.apache.pig.impl.logicalLayer.LogicalPlanBuilder.parse(LogicalPlanBuilder.java:47)
       at org.apache.pig.PigServer.registerQuery(PigServer.java:240)
at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:459) at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:226) at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:63)
       at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:60)
       at org.apache.pig.Main.main(Main.java:265)

--
Eric Zhang
408-349-2466
Vespa Content team

  • IndexOutOfBoundsException Eric Zhang