public abstract class VectorExpression extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected VectorExpression[] |
childExpressions
Child expressions for parameters -- but only those that need to be computed.
|
int[] |
inputColumnNum
Input column numbers of the vector expression, which should be reused by vector expressions.
|
protected DataTypePhysicalVariation[] |
inputDataTypePhysicalVariations |
protected TypeInfo[] |
inputTypeInfos
ALL input parameter type information is here including those for (non-computed) columns and
scalar values.
|
protected org.slf4j.Logger |
LOG |
int |
outputColumnNum
Output column number and type information of the vector expression.
|
protected DataTypePhysicalVariation |
outputDataTypePhysicalVariation |
protected TypeInfo |
outputTypeInfo |
Constructor and Description |
---|
VectorExpression() |
VectorExpression(int[] inputColumnNum,
int outputColumnNum)
Convenience method for expressions that uses arbitrary number of input columns in an array.
|
VectorExpression(int inputColumnNum,
int outputColumnNum)
Constructor for 1 input column and 1 output column.
|
VectorExpression(int inputColumnNum,
int inputColumnNum2,
int outputColumnNum)
Constructor for 2 input columns and 1 output column.
|
VectorExpression(int inputColumnNum,
int inputColumnNum2,
int inputColumnNum3,
int outputColumnNum)
Constructor for 3 input columns and 1 output column.
|
Modifier and Type | Method and Description |
---|---|
static String |
displayArrayOfUtf8ByteArrays(byte[][] arrayOfByteArrays) |
static String |
displayUtf8Bytes(byte[] bytes) |
static void |
doTransientInit(VectorExpression[] vecExprs,
org.apache.hadoop.conf.Configuration conf) |
static void |
doTransientInit(VectorExpression vecExpr,
org.apache.hadoop.conf.Configuration conf) |
abstract void |
evaluate(VectorizedRowBatch batch)
This is the primary method to implement expression logic.
|
protected void |
evaluateChildren(VectorizedRowBatch vrg)
Evaluate the child expressions on the given input batch.
|
VectorExpression[] |
getChildExpressions() |
protected String |
getColumnParamString(int typeNum,
int columnNum) |
abstract VectorExpressionDescriptor.Descriptor |
getDescriptor() |
protected String |
getDoubleValueParamString(int typeNum,
double value) |
DataTypePhysicalVariation[] |
getInputDataTypePhysicalVariations() |
TypeInfo[] |
getInputTypeInfos() |
protected String |
getLongValueParamString(int typeNum,
long value) |
int |
getOutputColumnNum()
Returns the index of the output column in the array
of column vectors.
|
ColumnVector.Type |
getOutputColumnVectorType() |
DataTypePhysicalVariation |
getOutputDataTypePhysicalVariation() |
TypeInfo |
getOutputTypeInfo()
Returns type of the output column.
|
protected String |
getParamTypeString(int typeNum) |
static String |
getTypeName(TypeInfo typeInfo,
DataTypePhysicalVariation dataTypePhysicalVariation) |
void |
init(org.apache.hadoop.conf.Configuration conf) |
void |
setChildExpressions(VectorExpression[] childExpressions)
Initialize the child expressions.
|
void |
setInputDataTypePhysicalVariations(DataTypePhysicalVariation... inputDataTypePhysicalVariations) |
void |
setInputTypeInfos(TypeInfo... inputTypeInfos) |
void |
setOutputDataTypePhysicalVariation(DataTypePhysicalVariation outputDataTypePhysicalVariation)
Set data type read variation.
|
void |
setOutputTypeInfo(TypeInfo outputTypeInfo)
Set type of the output column.
|
boolean |
supportsCheckedExecution()
A vector expression which implements a checked execution to account for overflow handling
should override this method and return true.
|
String |
toString() |
void |
transientInit(org.apache.hadoop.conf.Configuration conf) |
abstract String |
vectorExpressionParameters() |
protected final transient org.slf4j.Logger LOG
protected VectorExpression[] childExpressions
protected TypeInfo[] inputTypeInfos
protected DataTypePhysicalVariation[] inputDataTypePhysicalVariations
public int outputColumnNum
protected TypeInfo outputTypeInfo
protected DataTypePhysicalVariation outputDataTypePhysicalVariation
public int[] inputColumnNum
public VectorExpression()
public VectorExpression(int inputColumnNum, int outputColumnNum)
inputColumnNum
- outputColumnNum
- public VectorExpression(int inputColumnNum, int inputColumnNum2, int outputColumnNum)
inputColumnNum
- inputColumnNum2
- outputColumnNum
- public VectorExpression(int inputColumnNum, int inputColumnNum2, int inputColumnNum3, int outputColumnNum)
inputColumnNum
- inputColumnNum2
- inputColumnNum3
- outputColumnNum
- public VectorExpression(int[] inputColumnNum, int outputColumnNum)
inputColumnNum
- outputColumnNum
- public void setChildExpressions(VectorExpression[] childExpressions)
public VectorExpression[] getChildExpressions()
public void setInputTypeInfos(TypeInfo... inputTypeInfos)
public TypeInfo[] getInputTypeInfos()
public void setInputDataTypePhysicalVariations(DataTypePhysicalVariation... inputDataTypePhysicalVariations)
public DataTypePhysicalVariation[] getInputDataTypePhysicalVariations()
public abstract String vectorExpressionParameters()
public void transientInit(org.apache.hadoop.conf.Configuration conf) throws HiveException
HiveException
public static void doTransientInit(VectorExpression vecExpr, org.apache.hadoop.conf.Configuration conf) throws HiveException
HiveException
public static void doTransientInit(VectorExpression[] vecExprs, org.apache.hadoop.conf.Configuration conf) throws HiveException
HiveException
public int getOutputColumnNum()
public TypeInfo getOutputTypeInfo()
public void setOutputTypeInfo(TypeInfo outputTypeInfo)
public void setOutputDataTypePhysicalVariation(DataTypePhysicalVariation outputDataTypePhysicalVariation)
public DataTypePhysicalVariation getOutputDataTypePhysicalVariation()
public ColumnVector.Type getOutputColumnVectorType() throws HiveException
HiveException
public abstract void evaluate(VectorizedRowBatch batch) throws HiveException
batch
- HiveException
public void init(org.apache.hadoop.conf.Configuration conf)
public abstract VectorExpressionDescriptor.Descriptor getDescriptor()
protected final void evaluateChildren(VectorizedRowBatch vrg) throws HiveException
vrg
- VectorizedRowBatch
HiveException
protected String getColumnParamString(int typeNum, int columnNum)
protected String getLongValueParamString(int typeNum, long value)
protected String getDoubleValueParamString(int typeNum, double value)
protected String getParamTypeString(int typeNum)
public static String getTypeName(TypeInfo typeInfo, DataTypePhysicalVariation dataTypePhysicalVariation)
public boolean supportsCheckedExecution()
public static String displayUtf8Bytes(byte[] bytes)
public static String displayArrayOfUtf8ByteArrays(byte[][] arrayOfByteArrays)
Copyright © 2022 The Apache Software Foundation. All rights reserved.