Search in sources :

Example 1 with TranslateExpressions

use of io.prestosql.sql.planner.iterative.rule.TranslateExpressions 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)

Example 2 with TranslateExpressions

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

the class TestMergeWindows method assertUnitPlan.

private void assertUnitPlan(@Language("SQL") String sql, PlanMatchPattern pattern) {
    List<PlanOptimizer> optimizers = ImmutableList.of(new UnaliasSymbolReferences(getQueryRunner().getMetadata()), new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getCostCalculator(), new TranslateExpressions(getMetadata(), getQueryRunner().getSqlParser()).rules(getMetadata())), new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getEstimatedExchangesCostCalculator(), ImmutableSet.<Rule<?>>builder().add(new RemoveRedundantIdentityProjections()).addAll(GatherAndMergeWindows.rules()).build()), new PruneUnreferencedOutputs());
    assertPlan(sql, pattern, optimizers);
}
Also used : RuleStatsRecorder(io.prestosql.sql.planner.RuleStatsRecorder) RemoveRedundantIdentityProjections(io.prestosql.sql.planner.iterative.rule.RemoveRedundantIdentityProjections) IterativeOptimizer(io.prestosql.sql.planner.iterative.IterativeOptimizer) TranslateExpressions(io.prestosql.sql.planner.iterative.rule.TranslateExpressions)

Example 3 with TranslateExpressions

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

the class TestReorderWindows method assertUnitPlan.

private void assertUnitPlan(@Language("SQL") String sql, PlanMatchPattern pattern) {
    List<PlanOptimizer> optimizers = ImmutableList.of(new UnaliasSymbolReferences(getQueryRunner().getMetadata()), new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getCostCalculator(), new TranslateExpressions(getMetadata(), getQueryRunner().getSqlParser()).rules(getMetadata())), new PredicatePushDown(getQueryRunner().getMetadata(), new TypeAnalyzer(getQueryRunner().getSqlParser(), getQueryRunner().getMetadata()), new PlanOptimizers.CostCalculationHandle(getQueryRunner().getStatsCalculator(), getQueryRunner().getCostCalculator(), null), false, false, false), new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getEstimatedExchangesCostCalculator(), ImmutableSet.of(new RemoveRedundantIdentityProjections(), new GatherAndMergeWindows.SwapAdjacentWindowsBySpecifications(0), new GatherAndMergeWindows.SwapAdjacentWindowsBySpecifications(1), new GatherAndMergeWindows.SwapAdjacentWindowsBySpecifications(2))), new PruneUnreferencedOutputs());
    assertPlan(sql, pattern, optimizers);
}
Also used : GatherAndMergeWindows(io.prestosql.sql.planner.iterative.rule.GatherAndMergeWindows) RuleStatsRecorder(io.prestosql.sql.planner.RuleStatsRecorder) RemoveRedundantIdentityProjections(io.prestosql.sql.planner.iterative.rule.RemoveRedundantIdentityProjections) TypeAnalyzer(io.prestosql.sql.planner.TypeAnalyzer) IterativeOptimizer(io.prestosql.sql.planner.iterative.IterativeOptimizer) TranslateExpressions(io.prestosql.sql.planner.iterative.rule.TranslateExpressions)

Aggregations

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