use of org.apache.hadoop.hive.ql.exec.vector.VectorizationContext in project hive by apache.
the class VectorGroupByOperatorBench method setup.
@Setup
public void setup() {
try {
dataType = dataType.replaceAll("_", ",");
TypeInfo typeInfo = TypeInfoFactory.getPrimitiveTypeInfo(dataType);
ColumnVector cv = ColumnVectorGenUtil.generateColumnVector(typeInfo, hasNulls, isRepeating, size, rand);
TypeDescription typeDescription = TypeDescription.fromString(dataType);
vrb = typeDescription.createRowBatch(size);
vrb.size = size;
vrb.cols[0] = cv;
VectorizationContext ctx = new VectorizationContext("name", ImmutableList.of("A"));
GroupByDesc desc = buildGroupByDescType(aggregation, evalMode, "A", typeInfo, processMode);
Operator<? extends OperatorDesc> groupByOp = OperatorFactory.get(new CompilationOpContext(), desc);
VectorGroupByDesc vectorGroupByDesc = new VectorGroupByDesc();
vectorGroupByDesc.setProcessingMode(ProcessingMode.HASH);
vgo = (VectorGroupByOperator) Vectorizer.vectorizeGroupByOperator(groupByOp, ctx, vectorGroupByDesc);
vgo.initialize(new Configuration(), null);
} catch (Exception e) {
// likely unsupported combination of params
// https://bugs.openjdk.java.net/browse/CODETOOLS-7901296 is not available yet to skip benchmark cleanly
System.out.println("Skipping.. Exception: " + e.getMessage());
System.exit(0);
}
}
Aggregations