Search in sources :

Example 1 with FilterAndProjectOperator

use of io.prestosql.operator.FilterAndProjectOperator in project hetu-core by openlookeng.

the class PredicateFilterBenchmark method createOperatorFactories.

@Override
protected List<? extends OperatorFactory> createOperatorFactories() {
    OperatorFactory tableScanOperator = createTableScanOperator(0, new PlanNodeId("test"), "orders", "totalprice");
    RowExpression filter = call(GREATER_THAN_OR_EQUAL.name(), localQueryRunner.getMetadata().getFunctionAndTypeManager().resolveOperatorFunctionHandle(GREATER_THAN_OR_EQUAL, fromTypes(DOUBLE, DOUBLE)), BOOLEAN, field(0, DOUBLE), constant(50000.0, DOUBLE));
    ExpressionCompiler expressionCompiler = new ExpressionCompiler(localQueryRunner.getMetadata(), new PageFunctionCompiler(localQueryRunner.getMetadata(), 0));
    Supplier<PageProcessor> pageProcessor = expressionCompiler.compilePageProcessor(Optional.of(filter), ImmutableList.of(field(0, DOUBLE)));
    FilterAndProjectOperator.FilterAndProjectOperatorFactory filterAndProjectOperator = new FilterAndProjectOperator.FilterAndProjectOperatorFactory(1, new PlanNodeId("test"), pageProcessor, ImmutableList.of(DOUBLE), new DataSize(0, BYTE), 0);
    return ImmutableList.of(tableScanOperator, filterAndProjectOperator);
}
Also used : PlanNodeId(io.prestosql.spi.plan.PlanNodeId) PageFunctionCompiler(io.prestosql.sql.gen.PageFunctionCompiler) PageProcessor(io.prestosql.operator.project.PageProcessor) OperatorFactory(io.prestosql.operator.OperatorFactory) DataSize(io.airlift.units.DataSize) RowExpression(io.prestosql.spi.relation.RowExpression) ExpressionCompiler(io.prestosql.sql.gen.ExpressionCompiler) FilterAndProjectOperator(io.prestosql.operator.FilterAndProjectOperator)

Aggregations

DataSize (io.airlift.units.DataSize)1 FilterAndProjectOperator (io.prestosql.operator.FilterAndProjectOperator)1 OperatorFactory (io.prestosql.operator.OperatorFactory)1 PageProcessor (io.prestosql.operator.project.PageProcessor)1 PlanNodeId (io.prestosql.spi.plan.PlanNodeId)1 RowExpression (io.prestosql.spi.relation.RowExpression)1 ExpressionCompiler (io.prestosql.sql.gen.ExpressionCompiler)1 PageFunctionCompiler (io.prestosql.sql.gen.PageFunctionCompiler)1