Search in sources :

Example 1 with MultipleDistinctAggregationToMarkDistinct

use of io.prestosql.sql.planner.iterative.rule.MultipleDistinctAggregationToMarkDistinct in project hetu-core by openlookeng.

the class TestOptimizeMixedDistinctAggregations method assertUnitPlan.

private void assertUnitPlan(String sql, PlanMatchPattern pattern) {
    List<PlanOptimizer> optimizers = ImmutableList.of(new UnaliasSymbolReferences(getQueryRunner().getMetadata()), new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getEstimatedExchangesCostCalculator(), ImmutableSet.of(new RemoveRedundantIdentityProjections(), new SingleDistinctAggregationToGroupBy(), new MultipleDistinctAggregationToMarkDistinct())), new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getEstimatedExchangesCostCalculator(), new TranslateExpressions(getQueryRunner().getMetadata(), getQueryRunner().getSqlParser()).rules(getMetadata())), new OptimizeMixedDistinctAggregations(getQueryRunner().getMetadata()), new PruneUnreferencedOutputs());
    assertPlan(sql, pattern, optimizers);
}
Also used : RuleStatsRecorder(io.prestosql.sql.planner.RuleStatsRecorder) RemoveRedundantIdentityProjections(io.prestosql.sql.planner.iterative.rule.RemoveRedundantIdentityProjections) MultipleDistinctAggregationToMarkDistinct(io.prestosql.sql.planner.iterative.rule.MultipleDistinctAggregationToMarkDistinct) IterativeOptimizer(io.prestosql.sql.planner.iterative.IterativeOptimizer) TranslateExpressions(io.prestosql.sql.planner.iterative.rule.TranslateExpressions) SingleDistinctAggregationToGroupBy(io.prestosql.sql.planner.iterative.rule.SingleDistinctAggregationToGroupBy)

Aggregations

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