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

Thrift Set type not working with Hive

    XMLWordPrintableJSON

Details

    • Reviewed
    • Maps thrift's set type to hive's array type.

    Description

      Thrift supports List, Map and Struct complex types, which get mapped to Array, Map and Struct complex types in Hive respectively. However thrift Set type doesn't seem to be working.

      Here is an example thrift struct:

      namespace java sample.thrift
      
      struct setrow {
          1: required set<i32> ids,
          2: required string name,
      }
      

      A Hive table is created with ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.thrift.ThriftDeserializer' WITH SERDEPROPERTIES ('serialization.class'='sample.thrift.setrow', 'serialization.format'='org.apache.thrift.protocol.TBinaryProtocol').

      Describing the table shows:

      hive> describe settable; 
      OK
      ids                 	struct<>            from deserializer   
      name                string              	from deserializer
      

      Issuing a select query on set column throws SemanticException:

      hive> select ids from settable;
      FAILED: SemanticException java.lang.IllegalArgumentException: Error: name expected at the position 7 of 'struct<>' but '>' is found.
      

      Attachments

        1. HIVE-7892.1.patch
          27 kB
          Satish Mittal
        2. HIVE-7892.patch.txt
          25 kB
          Satish Mittal

        Activity

          People

            satish.mittal Satish Mittal
            satish.mittal Satish Mittal
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: