use of com.facebook.presto.operator.GenericPageProcessor in project presto by prestodb.
the class LocalQueryRunner method createHashProjectOperator.
public static OperatorFactory createHashProjectOperator(int operatorId, PlanNodeId planNodeId, List<Type> columnTypes) {
ImmutableList.Builder<ProjectionFunction> projectionFunctions = ImmutableList.builder();
for (int i = 0; i < columnTypes.size(); i++) {
projectionFunctions.add(ProjectionFunctions.singleColumn(columnTypes.get(i), i));
}
projectionFunctions.add(new HashProjectionFunction(columnTypes));
return new FilterAndProjectOperator.FilterAndProjectOperatorFactory(operatorId, planNodeId, () -> new GenericPageProcessor(FilterFunctions.TRUE_FUNCTION, projectionFunctions.build()), ImmutableList.copyOf(Iterables.concat(columnTypes, ImmutableList.of(BIGINT))));
}
use of com.facebook.presto.operator.GenericPageProcessor in project presto by prestodb.
the class FunctionAssertions method interpretedFilterProject.
private Operator interpretedFilterProject(Expression filter, Expression projection, Session session) {
FilterFunction filterFunction = new InterpretedInternalFilterFunction(filter, SYMBOL_TYPES, INPUT_MAPPING, metadata, SQL_PARSER, session);
ProjectionFunction projectionFunction = new InterpretedProjectionFunction(projection, SYMBOL_TYPES, INPUT_MAPPING, metadata, SQL_PARSER, session);
OperatorFactory operatorFactory = new FilterAndProjectOperator.FilterAndProjectOperatorFactory(0, new PlanNodeId("test"), () -> new GenericPageProcessor(filterFunction, ImmutableList.of(projectionFunction)), toTypes(ImmutableList.of(projectionFunction)));
return operatorFactory.createOperator(createDriverContext(session));
}
Aggregations