org.apache.hadoop.hive.serde2.lazybinary
Class LazyBinaryArray

java.lang.Object
  extended by org.apache.hadoop.hive.serde2.lazy.LazyObjectBase
      extended by org.apache.hadoop.hive.serde2.lazybinary.LazyBinaryObject<OI>
          extended by org.apache.hadoop.hive.serde2.lazybinary.LazyBinaryNonPrimitive<LazyBinaryListObjectInspector>
              extended by org.apache.hadoop.hive.serde2.lazybinary.LazyBinaryArray

public class LazyBinaryArray
extends LazyBinaryNonPrimitive<LazyBinaryListObjectInspector>

LazyBinaryArray is serialized as follows: start A b b b b b b end bytes[] -> |--------|---|---|---|---| ... |---|---| Section A is the null-bytes. Suppose the list has N elements, then there are (N+7)/8 bytes used as null-bytes. Each bit corresponds to an element and it indicates whether that element is null (0) or not null (1). After A, all b(s) represent the elements of the list. Each of them is again a LazyBinaryObject.


Field Summary
 
Fields inherited from class org.apache.hadoop.hive.serde2.lazybinary.LazyBinaryNonPrimitive
bytes, length, start
 
Constructor Summary
protected LazyBinaryArray(LazyBinaryListObjectInspector oi)
          Construct a LazyBinaryArray object with the ObjectInspector.
 
Method Summary
 List<Object> getList()
          Returns the List of actual primitive objects.
 Object getListElementObject(int index)
          Returns the actual primitive object at the index position inside the array represented by this LazyBinaryObject.
 int getListLength()
          Returns the array size.
 void init(ByteArrayRef bytes, int start, int length)
          Set the row data for this LazyBinaryArray.
 
Methods inherited from class org.apache.hadoop.hive.serde2.lazybinary.LazyBinaryNonPrimitive
getObject, hashCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazyBinaryArray

protected LazyBinaryArray(LazyBinaryListObjectInspector oi)
Construct a LazyBinaryArray object with the ObjectInspector.

Parameters:
oi - the oi representing the type of this LazyBinaryArray
Method Detail

init

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

Overrides:
init in class LazyBinaryNonPrimitive<LazyBinaryListObjectInspector>
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:
LazyObjectBase.init(ByteArrayRef, int, int)

getListElementObject

public Object getListElementObject(int index)
Returns the actual primitive object at the index position inside the array represented by this LazyBinaryObject.


getListLength

public int getListLength()
Returns the array size.


getList

public List<Object> getList()
Returns the List of actual primitive objects. Returns null for null array.



Copyright © 2013 The Apache Software Foundation