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 |
addRowToBatch(Object row,
StructObjectInspector oi,
int rowIndex,
VectorizedRowBatch batch,
org.apache.hadoop.io.DataOutputBuffer buffer)
Iterates through all columns in a given row and populates the 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 VectorizedRowBatch |
constructVectorizedRowBatch(StructObjectInspector oi)
Create VectorizedRowBatch from ObjectInspector
|
static VectorizedRowBatch |
constructVectorizedRowBatch(StructObjectInspector keyInspector,
StructObjectInspector valueInspector)
Create VectorizedRowBatch from key and value object inspectors
|
static StandardStructObjectInspector |
convertToStandardStructObjectInspector(StructObjectInspector structObjectInspector) |
static void |
debugDisplayBatch(VectorizedRowBatch batch,
String prefix) |
static void |
debugDisplayOneRow(VectorizedRowBatch batch,
int index,
String prefix) |
static String |
displayBytes(byte[] bytes,
int start,
int length) |
static VectorizedRowBatch |
makeLike(VectorizedRowBatch batch)
Make a new (scratch) batch, which is exactly "like" the batch provided, except that it's empty
|
static PrimitiveTypeInfo[] |
primitiveTypeInfosFromStructObjectInspector(StructObjectInspector structObjectInspector) |
static PrimitiveTypeInfo[] |
primitiveTypeInfosFromTypeNames(String[] typeNames) |
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.
|
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 VectorizedRowBatch constructVectorizedRowBatch(StructObjectInspector oi) throws HiveException
oi
- HiveException
public static VectorizedRowBatch constructVectorizedRowBatch(StructObjectInspector keyInspector, StructObjectInspector valueInspector) throws HiveException
keyInspector
- valueInspector
- HiveException
public static void addRowToBatch(Object row, StructObjectInspector oi, int rowIndex, VectorizedRowBatch batch, org.apache.hadoop.io.DataOutputBuffer buffer) throws HiveException
row
- oi
- rowIndex
- batch
- buffer
- HiveException
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 PrimitiveTypeInfo[] primitiveTypeInfosFromStructObjectInspector(StructObjectInspector structObjectInspector) throws HiveException
HiveException
public static PrimitiveTypeInfo[] primitiveTypeInfosFromTypeNames(String[] typeNames) throws HiveException
HiveException
public static VectorizedRowBatch makeLike(VectorizedRowBatch batch) throws HiveException
batch
- the batch to imitateHiveException
public static String displayBytes(byte[] bytes, int start, int length)
public static void debugDisplayOneRow(VectorizedRowBatch batch, int index, String prefix)
public static void debugDisplayBatch(VectorizedRowBatch batch, String prefix) throws HiveException
HiveException
Copyright © 2017 The Apache Software Foundation. All rights reserved.