org.apache.hadoop.hive.serde2.columnar
Class ColumnarStructBase

java.lang.Object
  extended by org.apache.hadoop.hive.serde2.columnar.ColumnarStructBase
All Implemented Interfaces:
SerDeStatsStruct
Direct Known Subclasses:
ColumnarStruct, LazyBinaryColumnarStruct

public abstract class ColumnarStructBase
extends Object
implements SerDeStatsStruct


Field Summary
protected  int[] prjColIDs
           
 
Constructor Summary
ColumnarStructBase(ObjectInspector oi, ArrayList<Integer> notSkippedColumnIDs)
           
 
Method Summary
protected abstract  LazyObjectBase createLazyObjectBase(ObjectInspector objectInspector)
          create the lazy object for this field
 Object getField(int fieldID)
          Get one field out of the struct.
 ArrayList<Object> getFieldsAsList()
          Get the values of the fields as an ArrayList.
protected abstract  int getLength(ObjectInspector objectInspector, ByteArrayRef cachedByteArrayRef, int start, int length)
          Check if the object is null and return the length of the stream
 long getRawDataSerializedSize()
          Rerurns the serialized size of the object.
 void init(BytesRefArrayWritable cols)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prjColIDs

protected int[] prjColIDs
Constructor Detail

ColumnarStructBase

public ColumnarStructBase(ObjectInspector oi,
                          ArrayList<Integer> notSkippedColumnIDs)
Method Detail

getField

public Object getField(int fieldID)
Get one field out of the struct. If the field is a primitive field, return the actual object. Otherwise return the LazyObject. This is because PrimitiveObjectInspector does not have control over the object used by the user - the user simply directly use the Object instead of going through Object PrimitiveObjectInspector.get(Object). NOTE: separator and nullSequence has to be the same each time this method is called. These two parameters are used only once to parse each record.

Parameters:
fieldID - The field ID
Returns:
The field as a LazyObject

getLength

protected abstract int getLength(ObjectInspector objectInspector,
                                 ByteArrayRef cachedByteArrayRef,
                                 int start,
                                 int length)
Check if the object is null and return the length of the stream

Parameters:
objectInspector -
cachedByteArrayRef - the bytes of the object
start - the start offset
length - the length
Returns:
-1 for null, >=0 for length

createLazyObjectBase

protected abstract LazyObjectBase createLazyObjectBase(ObjectInspector objectInspector)
create the lazy object for this field

Parameters:
objectInspector - the object inspector for the field
Returns:
the lazy object for the field

init

public void init(BytesRefArrayWritable cols)

getFieldsAsList

public ArrayList<Object> getFieldsAsList()
Get the values of the fields as an ArrayList.

Returns:
The values of the fields as an ArrayList.

getRawDataSerializedSize

public long getRawDataSerializedSize()
Description copied from interface: SerDeStatsStruct
Rerurns the serialized size of the object.

Specified by:
getRawDataSerializedSize in interface SerDeStatsStruct


Copyright © 2013 The Apache Software Foundation