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

show create table creating unusable DDL when field delimiter is \001

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.10.0
    • 0.12.0
    • CLI
    • None
    • CDH4.2
      Hive 0.10

    Description

      When including a "fields terminated by" in the create statement. If the delimiter is preceded by a \001, hive turns this into \u0001 which is correct. However it then gives you a ddl that does not work because the parser changes the \u0001 into u0001.

      Example:

      hive> create table j1 (a string) row format delimited fields terminated by '\001';

      hive> show create table j1;
      CREATE TABLE j1(
      a string)
      ROW FORMAT DELIMITED
      FIELDS TERMINATED BY '\u0001'
      STORED AS INPUTFORMAT
      'org.apache.hadoop.mapred.TextInputFormat'
      OUTPUTFORMAT
      'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
      LOCATION
      'hdfs://forza-1.cloud.rtp.cloudera.com:8020/user/hive/warehouse/j1'
      TBLPROPERTIES (
      'transient_lastDdlTime'='1369664999')

      hive> desc formatted j1;
      …shortened to save space
      Storage Desc Params:
      field.delim \u0001
      serialization.format \u0001

      hive> drop table j1;

      hive> CREATE TABLE j1(
      > a string)
      > ROW FORMAT DELIMITED
      > FIELDS TERMINATED BY '\u0001'
      > STORED AS INPUTFORMAT
      > 'org.apache.hadoop.mapred.TextInputFormat'
      > OUTPUTFORMAT
      > 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
      > LOCATION
      > 'hdfs://forza-1.cloud.rtp.cloudera.com:8020/user/hive/warehouse/j1'
      > TBLPROPERTIES (
      > 'transient_lastDdlTime'='1369664999');

      hive> desc formatted j1;
      …shortened to save space
      Storage Desc Params:
      field.delim u0001
      serialization.format u0001

      Attachments

        1. HIVE-4618.D11007.1.patch
          7 kB
          Phabricator

        Activity

          People

            navis Navis Ryu
            johndee Johndee Burks
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: