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

Avro SerDe causes incorrect behavior in unrelated tables

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None
    • None

    Description

      When I run a file that first creates an Avro table using the Avro SerDe, then immediately creates an LZO text table and inserts data into the LZO table, the resulting LZO table contain Avro data files. When I remove the Avro CREATE TABLE statement, the LZO table contains .lzo files as expected.

      DROP TABLE IF EXISTS avro_table;
      CREATE EXTERNAL TABLE avro_table
      ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.avro.AvroSerDe'
      STORED AS
      INPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat'
      OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat'
      TBLPROPERTIES ('avro.schema.literal' = '{
      "namespace": "testing.hive.avro.serde",
      "name": "test_record",
      "type": "record",
      "fields": [
      {"name":"int1", "type":"long"},
      {"name":"string1", "type":"string"}
      ]
      }');
      
      DROP TABLE IF EXISTS lzo_table;
      CREATE EXTERNAL TABLE lzo_table (
      id int,
      bool_col boolean,
      tinyint_col tinyint,
      smallint_col smallint,
      int_col int,
      bigint_col bigint,
      float_col float,
      double_col double,
      date_string_col string,
      string_col string,
      timestamp_col timestamp)
      STORED AS 
      INPUTFORMAT 'com.hadoop.mapred.DeprecatedLzoTextInputFormat'
      OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
      ;
      
      SET hive.exec.compress.output=true;
      SET mapred.output.compression.type=BLOCK;
      SET mapred.output.compression.codec=com.hadoop.compression.lzo.LzopCodec;
      SET hive.exec.dynamic.partition.mode=nonstrict;
      SET hive.exec.dynamic.partition=true;
      SET mapred.max.split.size=256000000;
      SET hive.input.format=org.apache.hadoop.hive.ql.io.CombineHiveInputFormat;
      insert overwrite table lzo_table SELECT id, bool_col, tinyint_col, smallint_col, int_col, bigint_col, float_col, double_col, date_string_col, string_col, timestamp_col FROM src_table;
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              skye Skye Wanderman-Milne
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: