public class VectorizedBatchUtil extends Object
Constructor and Description |
---|
VectorizedBatchUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
acidAddRowToBatch(Object row,
StructObjectInspector oi,
int rowIndex,
VectorizedRowBatch batch,
VectorizedRowBatchCtx context,
org.apache.hadoop.io.DataOutputBuffer buffer)
Iterates thru all the columns in a given row and populates the batch
from a given offset
|
static void |
addProjectedRowToBatchFrom(Object row,
StructObjectInspector oi,
int rowIndex,
VectorizedRowBatch batch,
org.apache.hadoop.io.DataOutputBuffer buffer)
Add only the projected column of a regular row to the specified vectorized row batch
|
static void |
addRowToBatchFrom(Object row,
StructObjectInspector oi,
int rowIndex,
int colOffset,
VectorizedRowBatch batch,
org.apache.hadoop.io.DataOutputBuffer buffer)
Iterates thru all the columns in a given row and populates the batch
from a given offset
|
static String[] |
columnNamesFromStructObjectInspector(StructObjectInspector structObjectInspector) |
static StandardStructObjectInspector |
convertToStandardStructObjectInspector(StructObjectInspector structObjectInspector) |
static ColumnVector |
createColumnVector(String typeName) |
static ColumnVector |
createColumnVector(TypeInfo typeInfo) |
static void |
debugDisplayBatch(VectorizedRowBatch batch,
String prefix) |
static void |
debugDisplayOneRow(VectorizedRowBatch batch,
int index,
String prefix) |
static StringBuilder |
debugFormatOneRow(VectorizedRowBatch batch,
int index,
String prefix,
StringBuilder sb) |
static String |
displayBytes(byte[] bytes,
int start,
int length) |
static org.apache.hadoop.io.Writable |
getPrimitiveWritable(PrimitiveObjectInspector.PrimitiveCategory primitiveCategory) |
static VectorizedRowBatch |
makeLike(VectorizedRowBatch batch)
Make a new (scratch) batch, which is exactly "like" the batch provided, except that it's empty
|
static void |
setBatchSize(VectorizedRowBatch batch,
int size)
Reduce the batch size for a vectorized row batch
|
static void |
setNoNullFields(VectorizedRowBatch batch)
Iterates thru all the column vectors and sets noNull to
specified value.
|
static void |
setNullColIsNullValue(ColumnVector cv,
int rowIndex)
Sets the IsNull value for ColumnVector at specified index
|
static void |
setRepeatingColumn(VectorizedRowBatch batch,
int column)
Iterates thru all the column vectors and sets repeating to
specified column.
|
static TypeInfo[] |
typeInfosFromStructObjectInspector(StructObjectInspector structObjectInspector) |
static TypeInfo[] |
typeInfosFromTypeNames(String[] typeNames) |
public static void setNullColIsNullValue(ColumnVector cv, int rowIndex)
cv
- rowIndex
- public static void setNoNullFields(VectorizedRowBatch batch)
batch
- Batch on which noNull is setpublic static void setRepeatingColumn(VectorizedRowBatch batch, int column)
public static void setBatchSize(VectorizedRowBatch batch, int size)
public static ColumnVector createColumnVector(String typeName)
public static ColumnVector createColumnVector(TypeInfo typeInfo)
public static void addRowToBatchFrom(Object row, StructObjectInspector oi, int rowIndex, int colOffset, VectorizedRowBatch batch, org.apache.hadoop.io.DataOutputBuffer buffer) throws HiveException
row
- Deserialized row objectoi
- Object insepector for that rowrowIndex
- index to which the row should be added to batchcolOffset
- offset from where the column beginsbatch
- Vectorized batch to which the row is added at rowIndexHiveException
public static void addProjectedRowToBatchFrom(Object row, StructObjectInspector oi, int rowIndex, VectorizedRowBatch batch, org.apache.hadoop.io.DataOutputBuffer buffer) throws HiveException
row
- the regular rowoi
- object inspector for the rowrowIndex
- the offset to add in the batchbatch
- vectorized row batchbuffer
- data output bufferHiveException
public static void acidAddRowToBatch(Object row, StructObjectInspector oi, int rowIndex, VectorizedRowBatch batch, VectorizedRowBatchCtx context, org.apache.hadoop.io.DataOutputBuffer buffer) throws HiveException
row
- Deserialized row objectoi
- Object insepector for that rowrowIndex
- index to which the row should be added to batchbatch
- Vectorized batch to which the row is added at rowIndexcontext
- context object for this vectorized batchbuffer
- HiveException
public static StandardStructObjectInspector convertToStandardStructObjectInspector(StructObjectInspector structObjectInspector) throws HiveException
HiveException
public static String[] columnNamesFromStructObjectInspector(StructObjectInspector structObjectInspector) throws HiveException
HiveException
public static TypeInfo[] typeInfosFromTypeNames(String[] typeNames) throws HiveException
HiveException
public static TypeInfo[] typeInfosFromStructObjectInspector(StructObjectInspector structObjectInspector)
public static VectorizedRowBatch makeLike(VectorizedRowBatch batch) throws HiveException
batch
- the batch to imitateHiveException
public static org.apache.hadoop.io.Writable getPrimitiveWritable(PrimitiveObjectInspector.PrimitiveCategory primitiveCategory)
public static String displayBytes(byte[] bytes, int start, int length)
public static void debugDisplayOneRow(VectorizedRowBatch batch, int index, String prefix)
public static StringBuilder debugFormatOneRow(VectorizedRowBatch batch, int index, String prefix, StringBuilder sb)
public static void debugDisplayBatch(VectorizedRowBatch batch, String prefix)
Copyright © 2016 The Apache Software Foundation. All rights reserved.