use of org.apache.hadoop.hive.ql.exec.vector.expressions.VectorElt in project hive by apache.
the class VectorizationContext method getEltExpression.
private VectorExpression getEltExpression(List<ExprNodeDesc> childExpr, TypeInfo returnType) throws HiveException {
int[] inputColumns = new int[childExpr.size()];
VectorExpression[] vectorChildren = getVectorExpressions(childExpr, VectorExpressionDescriptor.Mode.PROJECTION);
final int size = vectorChildren.length;
TypeInfo[] inputTypeInfos = new TypeInfo[size];
DataTypePhysicalVariation[] inputDataTypePhysicalVariations = new DataTypePhysicalVariation[size];
int i = 0;
for (VectorExpression ve : vectorChildren) {
inputColumns[i] = ve.getOutputColumnNum();
inputTypeInfos[i] = ve.getOutputTypeInfo();
inputDataTypePhysicalVariations[i++] = ve.getOutputDataTypePhysicalVariation();
}
final int outputColumnNum = ocm.allocateOutputColumn(returnType);
VectorElt vectorElt = new VectorElt(inputColumns, outputColumnNum);
vectorElt.setChildExpressions(vectorChildren);
vectorElt.setInputTypeInfos(inputTypeInfos);
vectorElt.setInputDataTypePhysicalVariations(inputDataTypePhysicalVariations);
vectorElt.setOutputTypeInfo(returnType);
vectorElt.setOutputDataTypePhysicalVariation(DataTypePhysicalVariation.NONE);
freeNonColumns(vectorChildren);
return vectorElt;
}
Aggregations