org.apache.hadoop.hive.serde2.objectinspector
Class StandardUnionObjectInspector

java.lang.Object
  extended by org.apache.hadoop.hive.serde2.objectinspector.StandardUnionObjectInspector
All Implemented Interfaces:
Cloneable, ObjectInspector, UnionObjectInspector

public class StandardUnionObjectInspector
extends Object
implements UnionObjectInspector

StandardUnionObjectInspector works on union data that is stored as UnionObject. It holds the list of the object inspectors corresponding to each type of the object the Union can hold. The UniobObject has tag followed by the object it is holding. Always use the ObjectInspectorFactory to create new ObjectInspector objects, instead of directly creating an instance of this class.


Nested Class Summary
static class StandardUnionObjectInspector.StandardUnion
           
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector
ObjectInspector.Category
 
Constructor Summary
StandardUnionObjectInspector(List<ObjectInspector> ois)
           
 
Method Summary
 ObjectInspector.Category getCategory()
          An ObjectInspector must inherit from one of the following interfaces if getCategory() returns: PRIMITIVE: PrimitiveObjectInspector LIST: ListObjectInspector MAP: MapObjectInspector STRUCT: StructObjectInspector.
 Object getField(Object o)
          Return the field based on the tag value associated with the Object.
 List<ObjectInspector> getObjectInspectors()
          Returns the array of ObjectInspectors that are for each of the tags.
 byte getTag(Object o)
          Return the tag of the object.
 String getTypeName()
          Returns the name of the data type that is inspected by this ObjectInspector.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StandardUnionObjectInspector

public StandardUnionObjectInspector(List<ObjectInspector> ois)
Method Detail

getObjectInspectors

public List<ObjectInspector> getObjectInspectors()
Description copied from interface: UnionObjectInspector
Returns the array of ObjectInspectors that are for each of the tags.

Specified by:
getObjectInspectors in interface UnionObjectInspector

getTag

public byte getTag(Object o)
Return the tag of the object.

Specified by:
getTag in interface UnionObjectInspector

getField

public Object getField(Object o)
Return the field based on the tag value associated with the Object.

Specified by:
getField in interface UnionObjectInspector

getCategory

public ObjectInspector.Category getCategory()
Description copied from interface: ObjectInspector
An ObjectInspector must inherit from one of the following interfaces if getCategory() returns: PRIMITIVE: PrimitiveObjectInspector LIST: ListObjectInspector MAP: MapObjectInspector STRUCT: StructObjectInspector.

Specified by:
getCategory in interface ObjectInspector

getTypeName

public String getTypeName()
Description copied from interface: ObjectInspector
Returns the name of the data type that is inspected by this ObjectInspector. This is used to display the type information to the user. For primitive types, the type name is standardized. For other types, the type name can be something like "list", "map", java class names, or user-defined type names similar to typedef.

Specified by:
getTypeName in interface ObjectInspector

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012 The Apache Software Foundation