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

Cannot add comment for kafka table

    XMLWordPrintableJSON

Details

    Description

      when using kafka-handler to create a kafka table, no matter whether the user specifies column comment or not, the comment will become 'from deserializer' when the 'show create table' command is used to view the table structure.
      You can refer to the following example:

      CREATE EXTERNAL TABLE `kafka_table`(
        `id` string, 
        `info` string comment 'comment 1', 
        `jsoninfo` struct<id:string,info:string> comment 'comment 2')
      ROW FORMAT SERDE 
        'org.apache.hadoop.hive.kafka.KafkaSerDe' 
      STORED BY 
        'org.apache.hadoop.hive.kafka.KafkaStorageHandler' 
      WITH SERDEPROPERTIES ( 
        'serialization.format'='1')
      LOCATION
        'hdfs://offlinehdfs/user/hive/warehouse/kafka_table'
      TBLPROPERTIES (
        'properties.bootstrap.servers'='xxxx', 
        'topic'='xxxx'
        ..........)
      

      The result is as follows:

      CREATE EXTERNAL TABLE `kafka_table`(
        `id` string COMMENT 'from deserializer', 
        `info` string COMMENT 'from deserializer', 
        `jsoninfo` struct<id:string,info:string> COMMENT 'from deserializer', 
        `__key` binary COMMENT 'from deserializer', 
        `__partition` int COMMENT 'from deserializer', 
        `__offset` bigint COMMENT 'from deserializer', 
        `__timestamp` bigint COMMENT 'from deserializer')
      ROW FORMAT SERDE 
        'org.apache.hadoop.hive.kafka.KafkaSerDe' 
      STORED BY 
        'org.apache.hadoop.hive.kafka.KafkaStorageHandler' 
      WITH SERDEPROPERTIES ( 
        'serialization.format'='1')
      LOCATION
        'hdfs://offlinehdfs/user/hive/warehouse/kafka_table'
      TBLPROPERTIES (
        .......)
      

      Attachments

        Issue Links

          Activity

            People

              ChangjiGuo ChangjiGuo
              ChangjiGuo ChangjiGuo
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 10m
                  1h 10m