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

SHOW CREATE TABLE doesn't output backticks for CLUSTERED by Col names

    XMLWordPrintableJSON

Details

    Description

      SHOW CREATE TABLE output uses backticks for all column names and partition column names but does not include backticks for CLUSTERED BY column names. This causes ParseException during table creation when any bucket column identifier matches reserved keywords 

      CREATE TABLE `test_ts_reserved_keyword7`(
      `member_id` varchar(8),
      `plan_nr` varchar(11),
      `timestamp` timestamp,
      `shared_ind` varchar(1),
      `user_id` varchar(8))
      CLUSTERED BY (
      member_nr,
      plan_nr,
      `timestamp`)
      INTO 4 BUCKETS;
      
      SHOW CREATE TABLE test_ts_reserved_keyword7;
      CREATE TABLE `test_ts_reserved_keyword7`(
      `member_id` varchar(8),
      `plan_nr` varchar(11),
      `timestamp` timestamp, 
      `shared_ind` varchar(1), 
      `user_id` varchar(8)) 
      CLUSTERED BY (
      member_id,
      plan_nr,
      timestamp)
      INTO 4 BUCKETS
      ROW FORMAT SERDE'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'STORED AS INPUTFORMAT'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat'OUTPUTFORMAT'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat';
      
      This fails with "Error while compiling statement: FAILED: ParseException line 13:0 cannot recognize input near 'timestamp' ')' 'INTO' in column name"

       

      Attachments

        Issue Links

          Activity

            People

              rtrivedi12 Riju Trivedi
              rtrivedi12 Riju Trivedi
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: