Search

What is ObjectInspector functionality ?



Hive uses ObjectInspector to analyze the internal structure of the row object and also
the structure of the individual columns. ObjectInspector provides a uniform way to access complex objects that can be stored in multiple formats in the memory, including:

  • Instance of a Java class (Thrift or native Java)
  • A standard Java object (we use java.util.List to represent Struct and Array, and use
    java.util.Map to represent Map)
  • A lazily-initialized object (For example, a Struct of string fields stored in a single Java string object with starting offset for each field)
  • A complex object can be represented by a pair of ObjectInspector and Java Object.
  • The ObjectInspector not only tells us the structure of the Object, but also gives us ways to access the internal fields inside the Object.