Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-22480

IndexOutOfBounds exception while reading ORC files written with empty positions list in first row index entry

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2.2, 2.3.6
    • 1.2.3, 1.3.0, 2.1.2, 2.2.1
    • ORC
    • None

    Description

      Although this should not happen, we may end up with empty positions list in first row index entry due to some bug (see ORC-569). Since positions in first row index are always zero, it would be good if the reader could still read these files instead of fail.

      The error stack looks like this:

      ERROR : FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.tez.TezTask. Vertex failed, vertexName=Map 1, vertexId=vertex_1566395485735_11359_2_00, diagnostics=[Task failed, taskId=task_1566395485735_11359_2_00_000000, diagnostics=[TaskAttempt 0 failed, info=[Error: Error while running task ( failure ) : attempt_1566395485735_11359_2_00_000000_0:java.lang.RuntimeException: java.lang.RuntimeException: java.io.IOException: java.lang.IndexOutOfBoundsException: Index: 0
      at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:218)
      at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.run(TezProcessor.java:172)
      at org.apache.tez.runtime.LogicalIOProcessorRuntimeTask.run(LogicalIOProcessorRuntimeTask.java:377)
      at org.apache.tez.runtime.task.TaskRunner2Callable$1.run(TaskRunner2Callable.java:73)
      at org.apache.tez.runtime.task.TaskRunner2Callable$1.run(TaskRunner2Callable.java:61)
      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:1869)
      at org.apache.tez.runtime.task.TaskRunner2Callable.callInternal(TaskRunner2Callable.java:61)
      at org.apache.tez.runtime.task.TaskRunner2Callable.callInternal(TaskRunner2Callable.java:37)
      at org.apache.tez.common.CallableWithNdc.call(CallableWithNdc.java:36)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.RuntimeException: java.io.IOException: java.lang.IndexOutOfBoundsException: Index: 0
      at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat$TezGroupedSplitsRecordReader.initNextRecordReader(TezGroupedSplitsInputFormat.java:206)
      at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat$TezGroupedSplitsRecordReader.<init>(TezGroupedSplitsInputFormat.java:145)
      at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat.getRecordReader(TezGroupedSplitsInputFormat.java:111)
      at org.apache.tez.mapreduce.lib.MRReaderMapred.setupOldRecordReader(MRReaderMapred.java:157)
      at org.apache.tez.mapreduce.lib.MRReaderMapred.setSplit(MRReaderMapred.java:83)
      at org.apache.tez.mapreduce.input.MRInput.initFromEventInternal(MRInput.java:694)
      at org.apache.tez.mapreduce.input.MRInput.initFromEvent(MRInput.java:653)
      at org.apache.tez.mapreduce.input.MRInputLegacy.checkAndAwaitRecordReaderInitialization(MRInputLegacy.java:145)
      at org.apache.tez.mapreduce.input.MRInputLegacy.init(MRInputLegacy.java:109)
      at org.apache.hadoop.hive.ql.exec.tez.MapRecordProcessor.getMRInput(MapRecordProcessor.java:525)
      at org.apache.hadoop.hive.ql.exec.tez.MapRecordProcessor.init(MapRecordProcessor.java:171)
      at org.apache.hadoop.hive.ql.exec.tez.TezProcessor.initializeAndRunProcessor(TezProcessor.java:188)
      ... 14 more
      Caused by: java.io.IOException: java.lang.IndexOutOfBoundsException: Index: 0
      at org.apache.hadoop.hive.io.HiveIOExceptionHandlerChain.handleRecordReaderCreationException(HiveIOExceptionHandlerChain.java:97)
      at org.apache.hadoop.hive.io.HiveIOExceptionHandlerUtil.handleRecordReaderCreationException(HiveIOExceptionHandlerUtil.java:57)
      at org.apache.hadoop.hive.ql.io.HiveInputFormat.getRecordReader(HiveInputFormat.java:380)
      at org.apache.hadoop.mapred.split.TezGroupedSplitsInputFormat$TezGroupedSplitsRecordReader.initNextRecordReader(TezGroupedSplitsInputFormat.java:203)
      ... 25 more
      Caused by: java.lang.IndexOutOfBoundsException: Index: 0
      at java.util.Collections$EmptyList.get(Collections.java:4456)
      at org.apache.orc.OrcProto$RowIndexEntry.getPositions(OrcProto.java:6867)
      at org.apache.orc.impl.RecordReaderUtils.addRgFilteredStreamToRanges(RecordReaderUtils.java:257)
      at org.apache.orc.impl.RecordReaderImpl.planReadPartialDataStreams(RecordReaderImpl.java:942)
      at org.apache.orc.impl.RecordReaderImpl.readPartialDataStreams(RecordReaderImpl.java:979)
      at org.apache.orc.impl.RecordReaderImpl.readStripe(RecordReaderImpl.java:863)
      at org.apache.orc.impl.RecordReaderImpl.advanceStripe(RecordReaderImpl.java:1003)
      at org.apache.orc.impl.RecordReaderImpl.advanceToNextRow(RecordReaderImpl.java:1038)
      at org.apache.orc.impl.RecordReaderImpl.<init>(RecordReaderImpl.java:218)
      at org.apache.hadoop.hive.ql.io.orc.RecordReaderImpl.<init>(RecordReaderImpl.java:63)
      at org.apache.hadoop.hive.ql.io.orc.ReaderImpl.rowsOptions(ReaderImpl.java:80)
      at org.apache.hadoop.hive.ql.io.orc.VectorizedOrcInputFormat$VectorizedOrcRecordReader.<init>(VectorizedOrcInputFormat.java:103)
      at org.apache.hadoop.hive.ql.io.orc.VectorizedOrcInputFormat.getRecordReader(VectorizedOrcInputFormat.java:188)
      at org.apache.hadoop.hive.ql.io.orc.OrcInputFormat.createVectorizedReader(OrcInputFormat.java:1738)
      at org.apache.hadoop.hive.ql.io.orc.OrcInputFormat.getRecordReader(OrcInputFormat.java:1749)
      at org.apache.hadoop.hive.ql.io.HiveInputFormat.getRecordReader(HiveInputFormat.java:377)
      ... 26 more
      

      Attachments

        1. HIVE-22480.branch-1.patch
          0.9 kB
          jcamachorodriguez
        2. HIVE-22480.branch-2.patch
          0.9 kB
          jcamachorodriguez

        Issue Links

          Activity

            People

              jcamacho Jesús Camacho Rodríguez
              jcamacho Jesús Camacho Rodríguez
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: