org.apache.hadoop.hive.serde2.lazy
Class LazyArray

java.lang.Object
  extended by org.apache.hadoop.hive.serde2.lazy.LazyNonPrimitive
      extended by org.apache.hadoop.hive.serde2.lazy.LazyArray
All Implemented Interfaces:
LazyObject

public class LazyArray
extends LazyNonPrimitive

LazyArray stores an array of Lazy Objects. LazyArray does not deal with the case of a NULL array. That is handled by LazyArrayObjectInspector.


Field Summary
 
Fields inherited from class org.apache.hadoop.hive.serde2.lazy.LazyNonPrimitive
bytes, length, start
 
Constructor Summary
protected LazyArray(TypeInfo typeInfo)
          Construct a LazyArray object with the TypeInfo.
 
Method Summary
protected  void enlargeArrays()
          Enlarge the size of arrays storing information for the elements inside the array.
 List<Object> getList(byte separator, org.apache.hadoop.io.Text nullSequence)
          Returns the List of actual primitive objects.
 Object getListElementObject(int index, byte separator, org.apache.hadoop.io.Text nullSequence)
          Returns the actual primitive object at the index position inside the array represented by this LazyObject.
 int getListLength(byte separator, org.apache.hadoop.io.Text nullSequence)
          Returns -1 for null array.
 void init(ByteArrayRef bytes, int start, int length)
          Set the row data for this LazyArray.
 
Methods inherited from class org.apache.hadoop.hive.serde2.lazy.LazyNonPrimitive
getObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazyArray

protected LazyArray(TypeInfo typeInfo)
Construct a LazyArray object with the TypeInfo.

Parameters:
typeInfo - the TypeInfo representing the type of this LazyArray.
Method Detail

init

public void init(ByteArrayRef bytes,
                 int start,
                 int length)
Set the row data for this LazyArray.

Specified by:
init in interface LazyObject
Overrides:
init in class LazyNonPrimitive
Parameters:
bytes - The wrapper of the byte[].
start - The start position inside the bytes.
length - The length of the data, starting from "start"
See Also:
LazyObject.init(ByteArrayRef, int, int)

enlargeArrays

protected void enlargeArrays()
Enlarge the size of arrays storing information for the elements inside the array.


getListElementObject

public Object getListElementObject(int index,
                                   byte separator,
                                   org.apache.hadoop.io.Text nullSequence)
Returns the actual primitive object at the index position inside the array represented by this LazyObject.


getListLength

public int getListLength(byte separator,
                         org.apache.hadoop.io.Text nullSequence)
Returns -1 for null array.


getList

public List<Object> getList(byte separator,
                            org.apache.hadoop.io.Text nullSequence)
Returns the List of actual primitive objects. Returns null for null array.



Copyright © 2009 The Apache Software Foundation