org.apache.hadoop.hive.serde2.lazy.objectinspector
Class LazyListObjectInspector

java.lang.Object
  extended by org.apache.hadoop.hive.serde2.lazy.objectinspector.LazyListObjectInspector
All Implemented Interfaces:
Cloneable, ListObjectInspector, ObjectInspector

public class LazyListObjectInspector
extends Object
implements ListObjectInspector

LazyListObjectInspector works on array data that is stored in LazyArray. Always use the ObjectInspectorFactory to create new ObjectInspector objects, instead of directly creating an instance of this class.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector
ObjectInspector.Category
 
Field Summary
static org.apache.commons.logging.Log LOG
           
 
Constructor Summary
protected LazyListObjectInspector(ObjectInspector listElementObjectInspector, byte separator, org.apache.hadoop.io.Text nullSequence, boolean escaped, byte escapeChar)
          Call ObjectInspectorFactory.getLazySimpleListObjectInspector instead.
 
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.
 byte getEscapeChar()
           
 List<?> getList(Object data)
          returns null for data = null.
 Object getListElement(Object data, int index)
          returns null for null list, out-of-the-range index.
 ObjectInspector getListElementObjectInspector()
           
 int getListLength(Object data)
          returns -1 for data = null.
 org.apache.hadoop.io.Text getNullSequence()
          Returns the NullSequence for this array.
 byte getSeparator()
          Returns the separator for delimiting items in this array.
 String getTypeName()
          Returns the name of the data type that is inspected by this ObjectInspector.
 boolean isEscaped()
           
 
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
Constructor Detail

LazyListObjectInspector

protected LazyListObjectInspector(ObjectInspector listElementObjectInspector,
                                  byte separator,
                                  org.apache.hadoop.io.Text nullSequence,
                                  boolean escaped,
                                  byte escapeChar)
Call ObjectInspectorFactory.getLazySimpleListObjectInspector instead.

Method Detail

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

getListElementObjectInspector

public ObjectInspector getListElementObjectInspector()
Specified by:
getListElementObjectInspector in interface ListObjectInspector

getListElement

public Object getListElement(Object data,
                             int index)
Description copied from interface: ListObjectInspector
returns null for null list, out-of-the-range index.

Specified by:
getListElement in interface ListObjectInspector

getListLength

public int getListLength(Object data)
Description copied from interface: ListObjectInspector
returns -1 for data = null.

Specified by:
getListLength in interface ListObjectInspector

getList

public List<?> getList(Object data)
Description copied from interface: ListObjectInspector
returns null for data = null. Note: This method should not return a List object that is reused by the same ListObjectInspector, because it's possible that the same ListObjectInspector will be used in multiple places in the code. However it's OK if the List object is part of the Object data.

Specified by:
getList in interface ListObjectInspector

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

getSeparator

public byte getSeparator()
Returns the separator for delimiting items in this array. Called by LazyArray.init(...).


getNullSequence

public org.apache.hadoop.io.Text getNullSequence()
Returns the NullSequence for this array. Called by LazyArray.init(...).


isEscaped

public boolean isEscaped()

getEscapeChar

public byte getEscapeChar()


Copyright © 2011 The Apache Software Foundation