Search in sources :

Example 1 with TpchQuery1OperatorFactory

use of io.trino.benchmark.HandTpchQuery1.TpchQuery1Operator.TpchQuery1OperatorFactory in project hetu-core by openlookeng.

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), Optional.empty()), doubleSum.bind(ImmutableList.of(3), Optional.empty()), doubleSum.bind(ImmutableList.of(4), Optional.empty()), longAverage.bind(ImmutableList.of(2), Optional.empty()), doubleAverage.bind(ImmutableList.of(5), Optional.empty()), doubleAverage.bind(ImmutableList.of(6), Optional.empty()), countFunction.bind(ImmutableList.of(2), Optional.empty())), Optional.empty(), Optional.empty(), 10_000, Optional.of(new DataSize(16, MEGABYTE)), JOIN_COMPILER, false);
    return ImmutableList.of(tableScanOperator, tpchQuery1Operator, aggregationOperator);
}
Also used : PlanNodeId(io.prestosql.spi.plan.PlanNodeId) OperatorFactory(io.prestosql.operator.OperatorFactory) HashAggregationOperatorFactory(io.prestosql.operator.HashAggregationOperator.HashAggregationOperatorFactory) TpchQuery1OperatorFactory(io.prestosql.benchmark.HandTpchQuery1.TpchQuery1Operator.TpchQuery1OperatorFactory) TpchQuery1OperatorFactory(io.prestosql.benchmark.HandTpchQuery1.TpchQuery1Operator.TpchQuery1OperatorFactory) DataSize(io.airlift.units.DataSize) HashAggregationOperatorFactory(io.prestosql.operator.HashAggregationOperator.HashAggregationOperatorFactory)

Example 2 with TpchQuery1OperatorFactory

use of io.trino.benchmark.HandTpchQuery1.TpchQuery1Operator.TpchQuery1OperatorFactory in project urban-eureka by errir503.

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), Optional.empty()), doubleSum.bind(ImmutableList.of(3), Optional.empty()), doubleSum.bind(ImmutableList.of(4), Optional.empty()), longAverage.bind(ImmutableList.of(2), Optional.empty()), doubleAverage.bind(ImmutableList.of(5), Optional.empty()), doubleAverage.bind(ImmutableList.of(6), Optional.empty()), countFunction.bind(ImmutableList.of(2), Optional.empty())), Optional.empty(), Optional.empty(), 10_000, Optional.of(new DataSize(16, MEGABYTE)), JOIN_COMPILER, false);
    return ImmutableList.of(tableScanOperator, tpchQuery1Operator, aggregationOperator);
}
Also used : PlanNodeId(com.facebook.presto.spi.plan.PlanNodeId) OperatorFactory(com.facebook.presto.operator.OperatorFactory) TpchQuery1OperatorFactory(com.facebook.presto.benchmark.HandTpchQuery1.TpchQuery1Operator.TpchQuery1OperatorFactory) HashAggregationOperatorFactory(com.facebook.presto.operator.HashAggregationOperator.HashAggregationOperatorFactory) TpchQuery1OperatorFactory(com.facebook.presto.benchmark.HandTpchQuery1.TpchQuery1Operator.TpchQuery1OperatorFactory) DataSize(io.airlift.units.DataSize) HashAggregationOperatorFactory(com.facebook.presto.operator.HashAggregationOperator.HashAggregationOperatorFactory)

Example 3 with TpchQuery1OperatorFactory

use of io.trino.benchmark.HandTpchQuery1.TpchQuery1Operator.TpchQuery1OperatorFactory 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);
}
Also used : PlanNodeId(io.trino.sql.planner.plan.PlanNodeId) JoinCompiler(io.trino.sql.gen.JoinCompiler) TpchQuery1OperatorFactory(io.trino.benchmark.HandTpchQuery1.TpchQuery1Operator.TpchQuery1OperatorFactory) OperatorFactory(io.trino.operator.OperatorFactory) HashAggregationOperatorFactory(io.trino.operator.HashAggregationOperator.HashAggregationOperatorFactory) TpchQuery1OperatorFactory(io.trino.benchmark.HandTpchQuery1.TpchQuery1Operator.TpchQuery1OperatorFactory) HashAggregationOperatorFactory(io.trino.operator.HashAggregationOperator.HashAggregationOperatorFactory)

Example 4 with TpchQuery1OperatorFactory

use of io.trino.benchmark.HandTpchQuery1.TpchQuery1Operator.TpchQuery1OperatorFactory in project presto by prestodb.

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), Optional.empty()), doubleSum.bind(ImmutableList.of(3), Optional.empty()), doubleSum.bind(ImmutableList.of(4), Optional.empty()), longAverage.bind(ImmutableList.of(2), Optional.empty()), doubleAverage.bind(ImmutableList.of(5), Optional.empty()), doubleAverage.bind(ImmutableList.of(6), Optional.empty()), countFunction.bind(ImmutableList.of(2), Optional.empty())), Optional.empty(), Optional.empty(), 10_000, Optional.of(new DataSize(16, MEGABYTE)), JOIN_COMPILER, false);
    return ImmutableList.of(tableScanOperator, tpchQuery1Operator, aggregationOperator);
}
Also used : PlanNodeId(com.facebook.presto.spi.plan.PlanNodeId) OperatorFactory(com.facebook.presto.operator.OperatorFactory) TpchQuery1OperatorFactory(com.facebook.presto.benchmark.HandTpchQuery1.TpchQuery1Operator.TpchQuery1OperatorFactory) HashAggregationOperatorFactory(com.facebook.presto.operator.HashAggregationOperator.HashAggregationOperatorFactory) TpchQuery1OperatorFactory(com.facebook.presto.benchmark.HandTpchQuery1.TpchQuery1Operator.TpchQuery1OperatorFactory) DataSize(io.airlift.units.DataSize) HashAggregationOperatorFactory(com.facebook.presto.operator.HashAggregationOperator.HashAggregationOperatorFactory)

Aggregations

DataSize (io.airlift.units.DataSize)3 TpchQuery1OperatorFactory (com.facebook.presto.benchmark.HandTpchQuery1.TpchQuery1Operator.TpchQuery1OperatorFactory)2 HashAggregationOperatorFactory (com.facebook.presto.operator.HashAggregationOperator.HashAggregationOperatorFactory)2 OperatorFactory (com.facebook.presto.operator.OperatorFactory)2 PlanNodeId (com.facebook.presto.spi.plan.PlanNodeId)2 TpchQuery1OperatorFactory (io.prestosql.benchmark.HandTpchQuery1.TpchQuery1Operator.TpchQuery1OperatorFactory)1 HashAggregationOperatorFactory (io.prestosql.operator.HashAggregationOperator.HashAggregationOperatorFactory)1 OperatorFactory (io.prestosql.operator.OperatorFactory)1 PlanNodeId (io.prestosql.spi.plan.PlanNodeId)1 TpchQuery1OperatorFactory (io.trino.benchmark.HandTpchQuery1.TpchQuery1Operator.TpchQuery1OperatorFactory)1 HashAggregationOperatorFactory (io.trino.operator.HashAggregationOperator.HashAggregationOperatorFactory)1 OperatorFactory (io.trino.operator.OperatorFactory)1 JoinCompiler (io.trino.sql.gen.JoinCompiler)1 PlanNodeId (io.trino.sql.planner.plan.PlanNodeId)1