public class VectorizedRowBatchCtx extends Object
| Constructor and Description |
|---|
VectorizedRowBatchCtx()
Constructor for VectorizedRowBatchCtx
|
VectorizedRowBatchCtx(StructObjectInspector rawRowOI,
StructObjectInspector rowOI,
Deserializer deserializer,
Map<String,Object> partitionValues,
Map<String,PrimitiveObjectInspector.PrimitiveCategory> partitionTypes)
Constructor for VectorizedRowBatchCtx
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPartitionColsToBatch(VectorizedRowBatch batch)
Add the partition values to the batch
|
void |
addRowToBatch(int rowIndex,
org.apache.hadoop.io.Writable rowBlob,
VectorizedRowBatch batch,
org.apache.hadoop.io.DataOutputBuffer buffer)
Adds the row to the batch after deserializing the row
|
static ColumnVector |
allocateColumnVector(String type,
int defaultSize) |
void |
convertRowBatchBlobToVectorizedBatch(Object rowBlob,
int rowsInBlob,
VectorizedRowBatch batch)
Deserialized set of rows and populates the batch
|
VectorizedRowBatch |
createVectorizedRowBatch()
Creates a Vectorized row batch and the column vectors.
|
void |
init(org.apache.hadoop.conf.Configuration hiveConf,
org.apache.hadoop.mapred.FileSplit split)
Initializes VectorizedRowBatch context based on the
split and Hive configuration (Job conf with hive Plan).
|
void |
init(Map<Integer,String> scratchColumnTypeMap,
StructObjectInspector rowOI)
Initializes the VectorizedRowBatch context based on an scratch column type map and
object inspector.
|
boolean |
isPartitionCol(int colnum)
Determine whether a given column is a partition column
|
public VectorizedRowBatchCtx(StructObjectInspector rawRowOI, StructObjectInspector rowOI, Deserializer deserializer, Map<String,Object> partitionValues, Map<String,PrimitiveObjectInspector.PrimitiveCategory> partitionTypes)
rawRowOI - OI for raw row data (EG without partition cols)rowOI - OI for the row (Raw row OI + partition OI)deserializer - Deserializer for the row datapartitionValues - Hash map of partition values. Key=TblColName value=PartitionValuepublic VectorizedRowBatchCtx()
public void init(Map<Integer,String> scratchColumnTypeMap, StructObjectInspector rowOI)
scratchColumnTypeMap - rowOI - Object inspector that shapes the column typespublic void init(org.apache.hadoop.conf.Configuration hiveConf,
org.apache.hadoop.mapred.FileSplit split)
throws ClassNotFoundException,
IOException,
SerDeException,
InstantiationException,
IllegalAccessException,
HiveException
hiveConf - Hive configuration using Hive plan is extractedsplit - File split of the file being readClassNotFoundExceptionIOExceptionSerDeExceptionInstantiationExceptionIllegalAccessExceptionHiveExceptionpublic VectorizedRowBatch createVectorizedRowBatch() throws HiveException
HiveExceptionpublic void addRowToBatch(int rowIndex,
org.apache.hadoop.io.Writable rowBlob,
VectorizedRowBatch batch,
org.apache.hadoop.io.DataOutputBuffer buffer)
throws HiveException,
SerDeException
rowIndex - Row index in the batch to which the row is addedrowBlob - Row blob (serialized version of row)batch - Vectorized batch to which the row is addedbuffer - a buffer to copy strings intoHiveExceptionSerDeExceptionpublic void convertRowBatchBlobToVectorizedBatch(Object rowBlob, int rowsInBlob, VectorizedRowBatch batch) throws SerDeException
rowBlob - to deserializebatch - Vectorized row batch which contains deserialized dataSerDeExceptionpublic void addPartitionColsToBatch(VectorizedRowBatch batch) throws HiveException
batch - HiveExceptionpublic final boolean isPartitionCol(int colnum)
colnum - column number in
VectorizedRowBatchs created by this context.public static ColumnVector allocateColumnVector(String type, int defaultSize)
Copyright © 2017 The Apache Software Foundation. All rights reserved.