use of org.apache.hadoop.hive.ql.exec.vector.ptf.VectorPTFEvaluatorBase in project hive by apache.
the class VectorPTFDesc method getEvaluators.
public static VectorPTFEvaluatorBase[] getEvaluators(VectorPTFDesc vectorPTFDesc, VectorPTFInfo vectorPTFInfo) {
String[] evaluatorFunctionNames = vectorPTFDesc.getEvaluatorFunctionNames();
int evaluatorCount = evaluatorFunctionNames.length;
WindowFrameDef[] evaluatorWindowFrameDefs = vectorPTFDesc.getEvaluatorWindowFrameDefs();
VectorExpression[] evaluatorInputExpressions = vectorPTFInfo.getEvaluatorInputExpressions();
Type[] evaluatorInputColumnVectorTypes = vectorPTFInfo.getEvaluatorInputColumnVectorTypes();
int[] outputColumnMap = vectorPTFInfo.getOutputColumnMap();
VectorPTFEvaluatorBase[] evaluators = new VectorPTFEvaluatorBase[evaluatorCount];
for (int i = 0; i < evaluatorCount; i++) {
String functionName = evaluatorFunctionNames[i];
WindowFrameDef windowFrameDef = evaluatorWindowFrameDefs[i];
SupportedFunctionType functionType = VectorPTFDesc.supportedFunctionsMap.get(functionName);
VectorExpression inputVectorExpression = evaluatorInputExpressions[i];
final Type columnVectorType = evaluatorInputColumnVectorTypes[i];
// The output* arrays start at index 0 for output evaluator aggregations.
final int outputColumnNum = outputColumnMap[i];
VectorPTFEvaluatorBase evaluator = VectorPTFDesc.getEvaluator(functionType, windowFrameDef, columnVectorType, inputVectorExpression, outputColumnNum);
evaluators[i] = evaluator;
}
return evaluators;
}
use of org.apache.hadoop.hive.ql.exec.vector.ptf.VectorPTFEvaluatorBase in project hive by apache.
the class VectorPTFDesc method getStreamingEvaluatorNums.
public static int[] getStreamingEvaluatorNums(VectorPTFEvaluatorBase[] evaluators) {
final int evaluatorCount = evaluators.length;
ArrayList<Integer> streamingEvaluatorNums = new ArrayList<Integer>();
for (int i = 0; i < evaluatorCount; i++) {
final VectorPTFEvaluatorBase evaluator = evaluators[i];
if (evaluator.streamsResult()) {
streamingEvaluatorNums.add(i);
}
}
return ArrayUtils.toPrimitive(streamingEvaluatorNums.toArray(new Integer[0]));
}
Aggregations