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

java.lang.Object
  extended by org.apache.hadoop.hive.serde2.columnar.ColumnarStructBase
      extended by org.apache.hadoop.hive.serde2.columnar.ColumnarStruct
All Implemented Interfaces:
SerDeStatsStruct

public class ColumnarStruct
extends ColumnarStructBase

ColumnarStruct is different from LazyStruct in that ColumnarStruct's field Object get parsed at its initialize time when call ColumnarStructBase.init(BytesRefArrayWritable cols), while LazyStruct parse fields in a lazy way.


Field Summary
 
Fields inherited from class org.apache.hadoop.hive.serde2.columnar.ColumnarStructBase
prjColIDs
 
Constructor Summary
ColumnarStruct(ObjectInspector oi)
          Construct a ColumnarStruct object with the TypeInfo.
ColumnarStruct(ObjectInspector oi, ArrayList<Integer> notSkippedColumnIDs, org.apache.hadoop.io.Text nullSequence)
          Construct a ColumnarStruct object with the TypeInfo.
 
Method Summary
protected  LazyObjectBase createLazyObjectBase(ObjectInspector objectInspector)
          create the lazy object for this field
protected  int getLength(ObjectInspector objectInspector, ByteArrayRef cachedByteArrayRef, int start, int fieldLen)
          Check if the object is null and return the length of the stream
 
Methods inherited from class org.apache.hadoop.hive.serde2.columnar.ColumnarStructBase
getField, getFieldsAsList, getRawDataSerializedSize, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnarStruct

public ColumnarStruct(ObjectInspector oi)
Construct a ColumnarStruct object with the TypeInfo. It creates the first level object at the first place

Parameters:
oi - the ObjectInspector representing the type of this LazyStruct.

ColumnarStruct

public ColumnarStruct(ObjectInspector oi,
                      ArrayList<Integer> notSkippedColumnIDs,
                      org.apache.hadoop.io.Text nullSequence)
Construct a ColumnarStruct object with the TypeInfo. It creates the first level object at the first place

Parameters:
oi - the ObjectInspector representing the type of this LazyStruct.
notSkippedColumnIDs - the column ids that should not be skipped
Method Detail

getLength

protected int getLength(ObjectInspector objectInspector,
                        ByteArrayRef cachedByteArrayRef,
                        int start,
                        int fieldLen)
Description copied from class: ColumnarStructBase
Check if the object is null and return the length of the stream

Specified by:
getLength in class ColumnarStructBase
cachedByteArrayRef - the bytes of the object
start - the start offset
fieldLen - the length
Returns:
-1 for null, >=0 for length

createLazyObjectBase

protected LazyObjectBase createLazyObjectBase(ObjectInspector objectInspector)
Description copied from class: ColumnarStructBase
create the lazy object for this field

Specified by:
createLazyObjectBase in class ColumnarStructBase
Parameters:
objectInspector - the object inspector for the field
Returns:
the lazy object for the field


Copyright © 2013 The Apache Software Foundation