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 void |
copyNonSelectedColumnVector(VectorizedRowBatch sourceBatch,
int sourceColumnNum,
VectorizedRowBatch targetBatch,
int targetColumnNum,
int size) |
static void |
copyNonSelectedColumnVector(VectorizedRowBatch sourceBatch,
int sourceColumnNum,
VectorizedRowBatch targetBatch,
int targetColumnNum,
int size,
int startIndex) |
static void |
copyRepeatingColumn(VectorizedRowBatch sourceBatch,
int sourceColumnNum,
VectorizedRowBatch targetBatch,
int targetColumnNum,
boolean setByValue) |
static ColumnVector |
createColumnVector(String typeName) |
static ColumnVector |
createColumnVector(String typeName,
DataTypePhysicalVariation dataTypePhysicalVariation) |
static ColumnVector |
createColumnVector(TypeInfo typeInfo) |
static ColumnVector |
createColumnVector(TypeInfo typeInfo,
DataTypePhysicalVariation dataTypePhysicalVariation) |
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 org.apache.hadoop.io.Writable |
getPrimitiveWritable(TypeInfo typeInfo) |
static VectorizedRowBatch |
makeLike(VectorizedRowBatch batch)
Make a new (scratch) batch, which is exactly "like" the batch provided, except that it's empty
|
static ColumnVector |
makeLikeColumnVector(ColumnVector source) |
static void |
setBatchSize(VectorizedRowBatch batch,
int size)
Reduce the batch size for a vectorized row batch
|
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 setRepeatingColumn(VectorizedRowBatch batch, int column)
public static void setBatchSize(VectorizedRowBatch batch, int size)
public static ColumnVector createColumnVector(String typeName)
public static ColumnVector createColumnVector(String typeName, DataTypePhysicalVariation dataTypePhysicalVariation)
public static ColumnVector createColumnVector(TypeInfo typeInfo)
public static ColumnVector createColumnVector(TypeInfo typeInfo, DataTypePhysicalVariation dataTypePhysicalVariation)
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 rowIndexHiveExceptionpublic 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 bufferHiveExceptionpublic 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 - HiveExceptionpublic static StandardStructObjectInspector convertToStandardStructObjectInspector(StructObjectInspector structObjectInspector) throws HiveException
HiveExceptionpublic static String[] columnNamesFromStructObjectInspector(StructObjectInspector structObjectInspector) throws HiveException
HiveExceptionpublic static TypeInfo[] typeInfosFromTypeNames(String[] typeNames) throws HiveException
HiveExceptionpublic static TypeInfo[] typeInfosFromStructObjectInspector(StructObjectInspector structObjectInspector)
public static ColumnVector makeLikeColumnVector(ColumnVector source) throws HiveException
HiveExceptionpublic static void copyNonSelectedColumnVector(VectorizedRowBatch sourceBatch, int sourceColumnNum, VectorizedRowBatch targetBatch, int targetColumnNum, int size)
public static void copyNonSelectedColumnVector(VectorizedRowBatch sourceBatch, int sourceColumnNum, VectorizedRowBatch targetBatch, int targetColumnNum, int size, int startIndex)
public static void copyRepeatingColumn(VectorizedRowBatch sourceBatch, int sourceColumnNum, VectorizedRowBatch targetBatch, int targetColumnNum, boolean setByValue)
public static VectorizedRowBatch makeLike(VectorizedRowBatch batch) throws HiveException
batch - the batch to imitateHiveExceptionpublic static org.apache.hadoop.io.Writable getPrimitiveWritable(TypeInfo typeInfo)
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 © 2022 The Apache Software Foundation. All rights reserved.