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

Import fails for tables created with default text, sequence and orc file formats using HCatalog API

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.11.0
    • Fix Version/s: 0.13.0
    • Component/s: HCatalog
    • Labels:
      None

      Description

      A table was created using HCatalog API with out specifying the file format, it defaults to:

      fileFormat=TextFile, inputformat=org.apache.hadoop.mapred.TextInputFormat, outputformat=org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat
      

      But, when hive fetches the table from the metastore, it strangely replaces the output format with org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
      and the comparison between source and target table fails.

      The code in org.apache.hadoop.hive.ql.parse.ImportSemanticAnalyzer#checkTable does a string comparison of classes and fails.

            // check IF/OF/Serde
            String existingifc = table.getInputFormatClass().getName();
            String importedifc = tableDesc.getInputFormat();
            String existingofc = table.getOutputFormatClass().getName();
            String importedofc = tableDesc.getOutputFormat();
            if ((!existingifc.equals(importedifc))
                || (!existingofc.equals(importedofc))) {
              throw new SemanticException(
                  ErrorMsg.INCOMPATIBLE_SCHEMA
                      .getMsg(" Table inputformat/outputformats do not match"));
            }
      

      This only affects tables with text and sequence file formats but not rc or orc.

      1. HIVE-5550.2.patch
        4 kB
        Sushanth Sowmyan
      2. HIVE-5550.3.patch
        5 kB
        Sushanth Sowmyan
      3. HIVE-5550.patch
        3 kB
        Sushanth Sowmyan

        Issue Links

          Activity

          Hide
          sushanth Sushanth Sowmyan added a comment -

          Uploading patch updating to HiveIgnoreKeyOutputFormat.

          Please note, however, that this api is a candidate for deprecation pretty soon.

          Show
          sushanth Sushanth Sowmyan added a comment - Uploading patch updating to HiveIgnoreKeyOutputFormat. Please note, however, that this api is a candidate for deprecation pretty soon.
          Hide
          sushanth Sushanth Sowmyan added a comment -

          Cancelling patch, patch did not contain change to SequenceFile as well.

          Show
          sushanth Sushanth Sowmyan added a comment - Cancelling patch, patch did not contain change to SequenceFile as well.
          Hide
          sushanth Sushanth Sowmyan added a comment -

          Updated patch attached.

          Show
          sushanth Sushanth Sowmyan added a comment - Updated patch attached.
          Hide
          hiveqa Hive QA added a comment -

          Overall: +1 all checks pass

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

          SUCCESS: +1 4680 tests passed

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

          Messages:

          Executing org.apache.hive.ptest.execution.PrepPhase
          Executing org.apache.hive.ptest.execution.ExecutionPhase
          Executing org.apache.hive.ptest.execution.ReportingPhase
          

          This message is automatically generated.

          ATTACHMENT ID: 12615038

          Show
          hiveqa Hive QA added a comment - Overall : +1 all checks pass Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12615038/HIVE-5550.2.patch SUCCESS: +1 4680 tests passed Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/386/testReport Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/386/console Messages: Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase This message is automatically generated. ATTACHMENT ID: 12615038
          Hide
          sushanth Sushanth Sowmyan added a comment -

          Cancelling previous patch, so as to update this api with orc support as well, while we're touching this.

          Show
          sushanth Sushanth Sowmyan added a comment - Cancelling previous patch, so as to update this api with orc support as well, while we're touching this.
          Hide
          sushanth Sushanth Sowmyan added a comment -

          Attached patch with orc support as well.

          Show
          sushanth Sushanth Sowmyan added a comment - Attached patch with orc support as well.
          Hide
          hiveqa Hive QA added a comment -

          Overall: +1 all checks pass

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

          SUCCESS: +1 4740 tests passed

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

          Messages:

          Executing org.apache.hive.ptest.execution.PrepPhase
          Executing org.apache.hive.ptest.execution.ExecutionPhase
          Executing org.apache.hive.ptest.execution.ReportingPhase
          

          This message is automatically generated.

          ATTACHMENT ID: 12616194

          Show
          hiveqa Hive QA added a comment - Overall : +1 all checks pass Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12616194/HIVE-5550.3.patch SUCCESS: +1 4740 tests passed Test results: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/481/testReport Console output: http://bigtop01.cloudera.org:8080/job/PreCommit-HIVE-Build/481/console Messages: Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase This message is automatically generated. ATTACHMENT ID: 12616194
          Hide
          thejas Thejas M Nair added a comment -

          +1

          Show
          thejas Thejas M Nair added a comment - +1
          Hide
          thejas Thejas M Nair added a comment -

          Patch committed to trunk. Thanks for the contribution Sushanth!

          Show
          thejas Thejas M Nair added a comment - Patch committed to trunk. Thanks for the contribution Sushanth!

            People

            • Assignee:
              sushanth Sushanth Sowmyan
              Reporter:
              svenkat Venkatesh Seetharam
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development