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

java.lang.Object
  extended by org.apache.hadoop.hive.serde2.objectinspector.LazySimpleStructObjectInspector
All Implemented Interfaces:
ObjectInspector, StructObjectInspector

public class LazySimpleStructObjectInspector
extends Object
implements StructObjectInspector

LazySimpleStructObjectInspector works on struct data that is stored in LazyStruct. The names of the struct fields and the internal structure of the struct fields are specified in the ctor of the LazySimpleStructObjectInspector. Always use the ObjectInspectorFactory to create new ObjectInspector objects, instead of directly creating an instance of this class.


Nested Class Summary
protected static class LazySimpleStructObjectInspector.MyField
           
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector
ObjectInspector.Category
 
Field Summary
protected  List<LazySimpleStructObjectInspector.MyField> fields
           
static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
protected LazySimpleStructObjectInspector(List<String> structFieldNames, List<ObjectInspector> structFieldObjectInspectors, byte separator, org.apache.hadoop.io.Text nullSequence, boolean lastColumnTakesRest)
          Call ObjectInspectorFactory.getLazySimpleStructObjectInspector instead.
protected LazySimpleStructObjectInspector(List<StructField> fields, byte separator, org.apache.hadoop.io.Text nullSequence)
           
 
Method Summary
 List<? extends StructField> getAllStructFieldRefs()
          Returns all the fields.
 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 getStructFieldData(Object data, StructField fieldRef)
          returns null for data = null.
 StructField getStructFieldRef(String fieldName)
          Look up a field.
 List<Object> getStructFieldsDataAsList(Object data)
          returns null for data = null.
 String getTypeName()
          Returns the name of the data type that is inspected by this ObjectInspector.
protected  void init(List<String> structFieldNames, List<ObjectInspector> structFieldObjectInspectors, byte separator, org.apache.hadoop.io.Text nullSequence, boolean lastColumnTakesRest)
           
protected  void init(List<StructField> fields, byte separator, org.apache.hadoop.io.Text nullSequence)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.commons.logging.Log LOG

fields

protected List<LazySimpleStructObjectInspector.MyField> fields
Constructor Detail

LazySimpleStructObjectInspector

protected LazySimpleStructObjectInspector(List<String> structFieldNames,
                                          List<ObjectInspector> structFieldObjectInspectors,
                                          byte separator,
                                          org.apache.hadoop.io.Text nullSequence,
                                          boolean lastColumnTakesRest)
Call ObjectInspectorFactory.getLazySimpleStructObjectInspector instead.


LazySimpleStructObjectInspector

protected LazySimpleStructObjectInspector(List<StructField> fields,
                                          byte separator,
                                          org.apache.hadoop.io.Text nullSequence)
Method Detail

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

init

protected void init(List<String> structFieldNames,
                    List<ObjectInspector> structFieldObjectInspectors,
                    byte separator,
                    org.apache.hadoop.io.Text nullSequence,
                    boolean lastColumnTakesRest)

init

protected void init(List<StructField> fields,
                    byte separator,
                    org.apache.hadoop.io.Text nullSequence)

getCategory

public final 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

getStructFieldRef

public StructField getStructFieldRef(String fieldName)
Description copied from interface: StructObjectInspector
Look up a field.

Specified by:
getStructFieldRef in interface StructObjectInspector

getAllStructFieldRefs

public List<? extends StructField> getAllStructFieldRefs()
Description copied from interface: StructObjectInspector
Returns all the fields.

Specified by:
getAllStructFieldRefs in interface StructObjectInspector

getStructFieldData

public Object getStructFieldData(Object data,
                                 StructField fieldRef)
Description copied from interface: StructObjectInspector
returns null for data = null.

Specified by:
getStructFieldData in interface StructObjectInspector

getStructFieldsDataAsList

public List<Object> getStructFieldsDataAsList(Object data)
Description copied from interface: StructObjectInspector
returns null for data = null.

Specified by:
getStructFieldsDataAsList in interface StructObjectInspector


Copyright © 2009 The Apache Software Foundation