use of io.trino.sql.gen.JoinCompiler in project trino by trinodb.
the class HandTpchQuery1 method createOperatorFactories.
@Override
protected List<? extends OperatorFactory> createOperatorFactories() {
// select
// returnflag,
// linestatus,
// sum(quantity) as sum_qty,
// sum(extendedprice) as sum_base_price,
// sum(extendedprice * (1 - discount)) as sum_disc_price,
// sum(extendedprice * (1 - discount) * (1 + tax)) as sum_charge,
// avg(quantity) as avg_qty,
// avg(extendedprice) as avg_price,
// avg(discount) as avg_disc,
// count(*) as count_order
// from
// lineitem
// where
// shipdate <= '1998-09-02'
// group by
// returnflag,
// linestatus
// order by
// returnflag,
// linestatus
OperatorFactory tableScanOperator = createTableScanOperator(0, new PlanNodeId("test"), "lineitem", "returnflag", "linestatus", "quantity", "extendedprice", "discount", "tax", "shipdate");
TpchQuery1OperatorFactory tpchQuery1Operator = new TpchQuery1OperatorFactory(1);
HashAggregationOperatorFactory aggregationOperator = new HashAggregationOperatorFactory(2, new PlanNodeId("test"), getColumnTypes("lineitem", "returnflag", "linestatus"), Ints.asList(0, 1), ImmutableList.of(), Step.SINGLE, ImmutableList.of(doubleSum.bind(ImmutableList.of(2)), doubleSum.bind(ImmutableList.of(3)), doubleSum.bind(ImmutableList.of(4)), longAverage.bind(ImmutableList.of(2)), doubleAverage.bind(ImmutableList.of(5)), doubleAverage.bind(ImmutableList.of(6)), countFunction.bind(ImmutableList.of(2))), Optional.empty(), Optional.empty(), 10_000, Optional.of(DataSize.of(16, MEGABYTE)), new JoinCompiler(localQueryRunner.getTypeOperators()), localQueryRunner.getBlockTypeOperators(), Optional.empty());
return ImmutableList.of(tableScanOperator, tpchQuery1Operator, aggregationOperator);
}
use of io.trino.sql.gen.JoinCompiler in project trino by trinodb.
the class HashAggregationBenchmark method createOperatorFactories.
@Override
protected List<? extends OperatorFactory> createOperatorFactories() {
List<Type> tableTypes = getColumnTypes("orders", "orderstatus", "totalprice");
OperatorFactory tableScanOperator = createTableScanOperator(0, new PlanNodeId("test"), "orders", "orderstatus", "totalprice");
HashAggregationOperatorFactory aggregationOperator = new HashAggregationOperatorFactory(1, new PlanNodeId("test"), ImmutableList.of(tableTypes.get(0)), Ints.asList(0), ImmutableList.of(), Step.SINGLE, ImmutableList.of(doubleSum.bind(ImmutableList.of(1))), Optional.empty(), Optional.empty(), 100_000, Optional.of(DataSize.of(16, MEGABYTE)), new JoinCompiler(localQueryRunner.getTypeOperators()), localQueryRunner.getBlockTypeOperators(), Optional.empty());
return ImmutableList.of(tableScanOperator, aggregationOperator);
}
Aggregations