Search in sources :

Example 1 with MultipleDistinctAggregationToMarkDistinct

use of io.trino.sql.planner.iterative.rule.MultipleDistinctAggregationToMarkDistinct in project trino by trinodb.

the class TestOptimizeMixedDistinctAggregations method assertUnitPlan.

private void assertUnitPlan(String sql, PlanMatchPattern pattern) {
    List<PlanOptimizer> optimizers = ImmutableList.of(new UnaliasSymbolReferences(getQueryRunner().getMetadata()), new IterativeOptimizer(getQueryRunner().getPlannerContext(), new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getEstimatedExchangesCostCalculator(), ImmutableSet.of(new RemoveRedundantIdentityProjections(), new SingleDistinctAggregationToGroupBy(), new MultipleDistinctAggregationToMarkDistinct())), new OptimizeMixedDistinctAggregations(getQueryRunner().getMetadata()), new IterativeOptimizer(getQueryRunner().getPlannerContext(), new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getEstimatedExchangesCostCalculator(), ImmutableSet.<Rule<?>>builder().add(new RemoveRedundantIdentityProjections()).addAll(columnPruningRules(getQueryRunner().getMetadata())).build()));
    assertPlan(sql, pattern, optimizers);
}
Also used : RuleStatsRecorder(io.trino.sql.planner.RuleStatsRecorder) RemoveRedundantIdentityProjections(io.trino.sql.planner.iterative.rule.RemoveRedundantIdentityProjections) MultipleDistinctAggregationToMarkDistinct(io.trino.sql.planner.iterative.rule.MultipleDistinctAggregationToMarkDistinct) IterativeOptimizer(io.trino.sql.planner.iterative.IterativeOptimizer) SingleDistinctAggregationToGroupBy(io.trino.sql.planner.iterative.rule.SingleDistinctAggregationToGroupBy)

Aggregations

RuleStatsRecorder (io.trino.sql.planner.RuleStatsRecorder)1 IterativeOptimizer (io.trino.sql.planner.iterative.IterativeOptimizer)1 MultipleDistinctAggregationToMarkDistinct (io.trino.sql.planner.iterative.rule.MultipleDistinctAggregationToMarkDistinct)1 RemoveRedundantIdentityProjections (io.trino.sql.planner.iterative.rule.RemoveRedundantIdentityProjections)1 SingleDistinctAggregationToGroupBy (io.trino.sql.planner.iterative.rule.SingleDistinctAggregationToGroupBy)1