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

Orc concatenation should enforce the compression buffer size

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.3.0, 2.0.0, 2.1.0
    • Fix Version/s: 1.3.0, 2.0.1, 2.1.0
    • Component/s: None
    • Labels:
      None

      Description

      With HIVE-11807 buffer size estimation happens by default. This can have undesired effect wrt file concatenation. Consider the following table with files

      testtable
        -- 000000_0 (created before HIVE-11807 which has buffer size 256KB)
        -- 000001_0 (created before HIVE-11807 which has buffer size 256KB)
        -- 000002_0 (created after HIVE-11807 with buffer size chosen as 128KB)
        -- 000003_0 (created after HIVE-11807 with buffer size chosen as 128KB)
      

      If we perform ALTER TABLE .. CONCATENATE on the above table with HIVE-11807, then depending on the split arrangement 000000_0 and 000001_0 will be concatenated together to new merged file. But this new merged file will have 128KB buffer size (estimated buffer size and not requested buffer size). Since new ORC writer size does not honor the requested buffer size the new merged files will have smaller buffers than the required 256KB making the file unreadable. Following exception will be thrown when reading the table after concatenation

      2016-03-24T16:26:33,974 ERROR [a9e27a9a-37cb-411d-9708-6c58a4ce34f2 main]: CliDriver (SessionState.java:printError(1049)) - Failed with exception java.io.IOException:java.lang.IllegalArgumentException: Buffer size too small. size = 131072 needed = 153187
      java.io.IOException: java.lang.IllegalArgumentException: Buffer size too small. size = 131072 needed = 153187
              at org.apache.hadoop.hive.ql.exec.FetchOperator.getNextRow(FetchOperator.java:513)
              at org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:420)
              at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:145)
              at org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:1848)
              at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:256)
              at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:187)
              at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:403)
              at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:782)
              at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:721)
              at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:648)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:497)
              at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
              at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
      

        Attachments

        1. HIVE-13361-branch-1.patch
          75 kB
          Prasanth Jayachandran
        2. HIVE-13361.1.patch
          75 kB
          Prasanth Jayachandran
        3. HIVE-13361.1.patch
          75 kB
          Prasanth Jayachandran
        4. alltypesorc3xcols
          1.43 MB
          Prasanth Jayachandran

          Issue Links

            Activity

              People

              • Assignee:
                prasanth_j Prasanth Jayachandran
                Reporter:
                yeeza Yi Zhang
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: