java.lang.IndexOutOfBoundsException

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

Thrown to indicate that an index of some sort (such as to an array, to a string, or to a vector) is out of range. Applications can subclass this class to indicate similar exceptions.


rafael

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • Re: python UDF invocation or memory problem
    via by Rohini Palaniswamy,
  • Re: python UDF invocation or memory problem
    via by Rohini Palaniswamy,
  • Re: python UDF invocation or memory problem
    via by Rohini Palaniswamy,
  • Re: python UDF invocation or memory problem
    via by Rohini Palaniswamy,
  • {code:title=test1.txt} {(,A1111,A),(,B222,B),(,C333,C)} {code} {code:title=test2.txt} A Helloworld B Pig C Hive {code} {code:title=tt.pig} A = LOAD 'test1.txt' AS (mybag:bag{t:tuple(title:chararray,name:chararray, id:chararray)}); A1 = FOREACH A generate flatten(mybag) as (title:chararray,name:chararray, id:chararray); B = LOAD 'test2.txt' AS (id:chararray, content:chararray); C = JOIN A1 BY id LEFT OUTER, B BY id; dump C; {code} {code} $ pig -x local -f tt.pig .... java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 at java.util.ArrayList.rangeCheck(ArrayList.java:604) at java.util.ArrayList.get(ArrayList.java:382) at org.apache.pig.data.DefaultTuple.get(DefaultTuple.java:115) at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POPackage.getValueTuple(POPackage.java:350) at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POPackage.getNext(POPackage.java:273) at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapReduce$Reduce.processOnePackageOutput(PigGenericMapReduce.java:425) at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapReduce$Reduce.reduce(PigGenericMapReduce.java:416) at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapReduce$Reduce.reduce(PigGenericMapReduce.java:256) at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:170) at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:636) at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:396) at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:441) [main] WARN org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MapReduceLauncher - Ooops! Some job has failed! Specify -stop_on_failu re if you want Pig to stop immediately on failure. ============== {code} If we change the code into this one: {code:title=tt.pig} A = LOAD 'test1.txt' AS (mybag:bag{t:tuple(title:chararray,name:chararray, id:chararray)}); A1 = FOREACH A generate flatten(mybag) as (title:chararray,name:chararray, id:chararray); A1 = FOREACH A1 generate title,name,id; B = LOAD 'test2.txt' AS (id:chararray, content:chararray); C = JOIN A1 BY id LEFT OUTER, B BY id; dump C; {code} The job succeed, and here is the result of execution. {code} ======== (,A1111,A,A,Helloworld) (,B222,B,B,Pig) (,C333,C,C,Hive) (,,,,) ======== {code}
    via by Bing Jiang,
  • Why do i get this exception?
    via by Unknown author,
  • Doesn't package on linux
    via GitHub by nukesparrow
    ,
    • java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 at java.util.ArrayList.rangeCheck(ArrayList.java:638) at java.util.ArrayList.get(ArrayList.java:414) at org.apache.pig.data.DefaultTuple.get(DefaultTuple.java:118) at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POPackage.getValueTuple(POPackage.java:348) at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POPackage.getNextTuple(POPackage.java:269) at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapReduce$Reduce.processOnePackageOutput(PigGenericMapReduce.java:421) at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapReduce$Reduce.reduce(PigGenericMapReduce.java:412) at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigGenericMapReduce$Reduce.reduce(PigGenericMapReduce.java:256) at org.apache.hadoop.mapreduce.Reducer.run(Reducer.java:171) at org.apache.hadoop.mapred.ReduceTask.runNewReducer(ReduceTask.java:627) at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:389) at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:422) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1642) at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:163)

    Users with the same issue

    Pilleo
    9 times, last one,
    Agócs Tamás
    8 times, last one,
    aidoan
    2 times, last one,
    Unknown visitor1 times, last one,
    nasimk
    2 times, last one,
    235 more bugmates