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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.11.0
    • 0.13.0
    • HCatalog
    • 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.

      Attachments

        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

            People

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

              Dates

                Created:
                Updated:
                Resolved: