Search code examples
hadoophiveudf

How can we write a custom ObjectInspector in Hive for a custom Writable type?


I am trying to write a custom writable type for a complex object type - to control the serialization and de-serialization.

And I want to create a ObjectInspector for that, i tried to find out an example for the same. But no suitable example is available.


Solution

  • I don't think you need to write a custom ObjectInspector for this. Have you tried to implement it as a custom SerDe? Checkout this blog from Cloudera for more details.

    If you're curious about how to implement custom ObjectInspectors, you can checkout an example of ProtobufStructObjectInspector from Elephant Bird.

    EDIT: Added an example of ObjectInspector implementation for posterity.