Hive fails to deserialize optional thrift fields -


When I create a table-like

  CREATE TABLE mytable line format serde "org. as Apache Khadoopkhivekserde2kthriftkThriftDeserializer "with serdeproperties (" serialization.class "=" com.myco.MyClass "," serialization.format "=" org.apache.thrift.protocol.TJSONProtocol ") SEQUENCEFILE Deposited in  

This works fine for saving structures with required fields

  struct MyClass {1: Required I32 foo; }  

but alternative fields such as structures

  struct MyClass2 {1: optional i32 foo; & Gt; struct & lt: SemanticException java.lang.IllegalArgumentException :: Error: Name expect 'int Condition 11}  

The following error

  failed to pay; 'But' & gt; is found. Since  

allows the hive values ​​for zero columns, there is a clear mapping of alternative constructions.

Can I hace the deserialize classes with optional fields?

Thanks,

Mike

Which Thift version Are you compiling your savings file? I'm at hive 12 and this was an exact error with saving on 0.9.x. I downgraded my savings version to 0.7.0 and it works fine with Hive 12.

Downgrade your savings version to generate savings Java files when you are stuck with the current hive version. In the hive, the ThriftDeserializer does not ignore certain areas, it is considered and creates alternative empty structs, which the hive can not handle.

hive version used off you are on, check and see what use they Reflections version for reflection and use Thift version was compiled Java your Traft schema.


Comments