Hive
  1. Hive
  2. HIVE-6320

Row-based ORC reader with PPD turned on dies on BufferUnderFlowException

    Details

      Description

      ORC data reader crashes out on a BufferUnderflowException, while trying to read data row-by-row with the predicate push-down enabled on current trunk.

      Caused by: java.nio.BufferUnderflowException
      	at java.nio.Buffer.nextGetIndex(Buffer.java:472)
      	at java.nio.HeapByteBuffer.get(HeapByteBuffer.java:117)
      	at org.apache.hadoop.hive.ql.io.orc.InStream$CompressedStream.read(InStream.java:207)
      	at org.apache.hadoop.hive.ql.io.orc.SerializationUtils.readInts(SerializationUtils.java:450)
      	at org.apache.hadoop.hive.ql.io.orc.RunLengthIntegerReaderV2.readDirectValues(RunLengthIntegerReaderV2.java:240)
      	at org.apache.hadoop.hive.ql.io.orc.RunLengthIntegerReaderV2.readValues(RunLengthIntegerReaderV2.java:53)
      	at org.apache.hadoop.hive.ql.io.orc.RunLengthIntegerReaderV2.next(RunLengthIntegerReaderV2.java:288)
      	at org.apache.hadoop.hive.ql.io.orc.RecordReaderImpl$IntTreeReader.next(RecordReaderImpl.java:510)
      	at org.apache.hadoop.hive.ql.io.orc.RecordReaderImpl$StructTreeReader.next(RecordReaderImpl.java:1581)
      	at org.apache.hadoop.hive.ql.io.orc.RecordReaderImpl.next(RecordReaderImpl.java:2707)
      	at org.apache.hadoop.hive.ql.io.orc.OrcInputFormat$OrcRecordReader.next(OrcInputFormat.java:125)
      	at org.apache.hadoop.hive.ql.io.orc.OrcInputFormat$OrcRecordReader.next(OrcInputFormat.java:101)
      

      The query run is

      set hive.vectorized.execution.enabled=false;
      set hive.optimize.index.filter=true;
      
      insert overwrite directory '/tmp/foo' select * from lineitem where l_orderkey is not null;
      
      1. HIVE-6320.1.patch
        2 kB
        Prasanth J
      2. HIVE-6320.2.patch
        2 kB
        Prasanth J
      3. HIVE-6320.2.patch
        2 kB
        Prasanth J
      4. HIVE-6320.3.patch
        3 kB
        Prasanth J

        Issue Links

          Activity

          Gopal V created issue -
          Gopal V made changes -
          Field Original Value New Value
          Remote Link This issue links to "Reproduction test-case (54Mb file) (Web Link)" [ 13837 ]
          Hide
          Prasanth J added a comment -

          The issue was related to generating the disk range boundaries. If two adjacent row groups have same compressed block offset then the worst case slop that was added to the end offset will contain only the current compression block. In some cases the values towards the end of this compression block will stretch beyond the boundary to fetch values causing BufferUnderFlowException.

          The attached patch extends this worst case slop boundary to safely accommodate the adjacent compression block.

          Show
          Prasanth J added a comment - The issue was related to generating the disk range boundaries. If two adjacent row groups have same compressed block offset then the worst case slop that was added to the end offset will contain only the current compression block. In some cases the values towards the end of this compression block will stretch beyond the boundary to fetch values causing BufferUnderFlowException. The attached patch extends this worst case slop boundary to safely accommodate the adjacent compression block.
          Prasanth J made changes -
          Attachment HIVE-6320.1.patch [ 12626175 ]
          Prasanth J made changes -
          Assignee Prasanth J [ prasanth_j ]
          Hide
          Prasanth J added a comment -

          Making it patch available for precommit tests.

          Show
          Prasanth J added a comment - Making it patch available for precommit tests.
          Prasanth J made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Prasanth J made changes -
          Remote Link This issue links to "Review Board (Web Link)" [ 14014 ]
          Hide
          Hive QA added a comment -

          Overall: -1 at least one tests failed

          Here are the results of testing the latest attachment:
          https://issues.apache.org/jira/secure/attachment/12626175/HIVE-6320.1.patch

          ERROR: -1 due to 1 failed/errored test(s), 4980 tests executed
          Failed tests:

          org.apache.hadoop.hive.cli.TestMinimrCliDriver.testCliDriver_auto_sortmerge_join_16
          

          Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1127/testReport
          Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1127/console

          Messages:

          Executing org.apache.hive.ptest.execution.PrepPhase
          Executing org.apache.hive.ptest.execution.ExecutionPhase
          Executing org.apache.hive.ptest.execution.ReportingPhase
          Tests exited with: TestsFailedException: 1 tests failed
          

          This message is automatically generated.

          ATTACHMENT ID: 12626175

          Show
          Hive QA added a comment - Overall : -1 at least one tests failed Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12626175/HIVE-6320.1.patch ERROR: -1 due to 1 failed/errored test(s), 4980 tests executed Failed tests: org.apache.hadoop.hive.cli.TestMinimrCliDriver.testCliDriver_auto_sortmerge_join_16 Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1127/testReport Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1127/console Messages: Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 1 tests failed This message is automatically generated. ATTACHMENT ID: 12626175
          Hide
          Prasanth J added a comment -

          The test failures seems to be unrelated.

          Show
          Prasanth J added a comment - The test failures seems to be unrelated.
          Hide
          Owen O'Malley added a comment -

          Actually, you always need the next 2 compression blocks regardless of whether the compression blocks are the same for the two row groups.

          The rest of the patch looks good.

          Show
          Owen O'Malley added a comment - Actually, you always need the next 2 compression blocks regardless of whether the compression blocks are the same for the two row groups. The rest of the patch looks good.
          Hide
          Prasanth J added a comment -

          Addressed Owen O'Malley and Gopal V's code review comments.

          Show
          Prasanth J added a comment - Addressed Owen O'Malley and Gopal V 's code review comments.
          Prasanth J made changes -
          Attachment HIVE-6320.2.patch [ 12626768 ]
          Hide
          Prasanth J added a comment -

          HIVE QA did not pickup the patch. Uploading again.

          Show
          Prasanth J added a comment - HIVE QA did not pickup the patch. Uploading again.
          Prasanth J made changes -
          Attachment HIVE-6320.2.patch [ 12626807 ]
          Hide
          Hive QA added a comment -

          Overall: -1 at least one tests failed

          Here are the results of testing the latest attachment:
          https://issues.apache.org/jira/secure/attachment/12626807/HIVE-6320.2.patch

          ERROR: -1 due to 4 failed/errored test(s), 4997 tests executed
          Failed tests:

          org.apache.hadoop.hive.cli.TestMinimrCliDriver.testCliDriver_bucketizedhiveinputformat
          org.apache.hadoop.hive.cli.TestNegativeMinimrCliDriver.testNegativeCliDriver_mapreduce_stack_trace_hadoop20
          org.apache.hadoop.hive.cli.TestNegativeMinimrCliDriver.testNegativeCliDriver_mapreduce_stack_trace_turnoff_hadoop20
          org.apache.hadoop.hive.ql.io.orc.TestRecordReaderImpl.testPartialPlanCompressed
          

          Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1171/testReport
          Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1171/console

          Messages:

          Executing org.apache.hive.ptest.execution.PrepPhase
          Executing org.apache.hive.ptest.execution.ExecutionPhase
          Executing org.apache.hive.ptest.execution.ReportingPhase
          Tests exited with: TestsFailedException: 4 tests failed
          

          This message is automatically generated.

          ATTACHMENT ID: 12626807

          Show
          Hive QA added a comment - Overall : -1 at least one tests failed Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12626807/HIVE-6320.2.patch ERROR: -1 due to 4 failed/errored test(s), 4997 tests executed Failed tests: org.apache.hadoop.hive.cli.TestMinimrCliDriver.testCliDriver_bucketizedhiveinputformat org.apache.hadoop.hive.cli.TestNegativeMinimrCliDriver.testNegativeCliDriver_mapreduce_stack_trace_hadoop20 org.apache.hadoop.hive.cli.TestNegativeMinimrCliDriver.testNegativeCliDriver_mapreduce_stack_trace_turnoff_hadoop20 org.apache.hadoop.hive.ql.io.orc.TestRecordReaderImpl.testPartialPlanCompressed Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1171/testReport Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1171/console Messages: Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 4 tests failed This message is automatically generated. ATTACHMENT ID: 12626807
          Hide
          Prasanth J added a comment -

          Fixed TestRecordReaderImpl.java test failure. Other failures seems unrelated.

          Show
          Prasanth J added a comment - Fixed TestRecordReaderImpl.java test failure. Other failures seems unrelated.
          Prasanth J made changes -
          Attachment HIVE-6320.3.patch [ 12626832 ]
          Hide
          Hive QA added a comment -

          Overall: -1 at least one tests failed

          Here are the results of testing the latest attachment:
          https://issues.apache.org/jira/secure/attachment/12626832/HIVE-6320.3.patch

          ERROR: -1 due to 1 failed/errored test(s), 4997 tests executed
          Failed tests:

          org.apache.hadoop.hive.common.type.TestDecimal128.testHighPrecisionDecimal128Multiply
          

          Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1174/testReport
          Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1174/console

          Messages:

          Executing org.apache.hive.ptest.execution.PrepPhase
          Executing org.apache.hive.ptest.execution.ExecutionPhase
          Executing org.apache.hive.ptest.execution.ReportingPhase
          Tests exited with: TestsFailedException: 1 tests failed
          

          This message is automatically generated.

          ATTACHMENT ID: 12626832

          Show
          Hive QA added a comment - Overall : -1 at least one tests failed Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12626832/HIVE-6320.3.patch ERROR: -1 due to 1 failed/errored test(s), 4997 tests executed Failed tests: org.apache.hadoop.hive.common.type.TestDecimal128.testHighPrecisionDecimal128Multiply Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1174/testReport Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/1174/console Messages: Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 1 tests failed This message is automatically generated. ATTACHMENT ID: 12626832
          Hide
          Prasanth J added a comment -

          The failed test is not related to this bug.

          Show
          Prasanth J added a comment - The failed test is not related to this bug.
          Hide
          Owen O'Malley added a comment -

          +1

          Show
          Owen O'Malley added a comment - +1
          Hide
          Gunther Hagleitner added a comment -

          Committed to trunk. Thanks Prasanth J and Owen O'Malley.

          Show
          Gunther Hagleitner added a comment - Committed to trunk. Thanks Prasanth J and Owen O'Malley .
          Gunther Hagleitner made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Fix Version/s 0.13.0 [ 12324986 ]
          Resolution Fixed [ 1 ]

            People

            • Assignee:
              Prasanth J
              Reporter:
              Gopal V
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development