Search in sources :

Example 1 with RemoveRedundantIdentityProjections

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

the class TestEliminateSorts method assertUnitPlan.

private void assertUnitPlan(@Language("SQL") String sql, PlanMatchPattern pattern) {
    List<PlanOptimizer> optimizers = ImmutableList.of(new UnaliasSymbolReferences(getQueryRunner().getMetadata()), new AddExchanges(getQueryRunner().getMetadata(), new TypeAnalyzer(new SqlParser(), getQueryRunner().getMetadata()), true), new PruneUnreferencedOutputs(), new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getCostCalculator(), ImmutableSet.of(new RemoveRedundantIdentityProjections())));
    assertPlan(sql, pattern, optimizers);
}
Also used : RuleStatsRecorder(io.prestosql.sql.planner.RuleStatsRecorder) RemoveRedundantIdentityProjections(io.prestosql.sql.planner.iterative.rule.RemoveRedundantIdentityProjections) SqlParser(io.prestosql.sql.parser.SqlParser) IterativeOptimizer(io.prestosql.sql.planner.iterative.IterativeOptimizer) TypeAnalyzer(io.prestosql.sql.planner.TypeAnalyzer)

Example 2 with RemoveRedundantIdentityProjections

use of io.prestosql.sql.planner.iterative.rule.RemoveRedundantIdentityProjections 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 3 with RemoveRedundantIdentityProjections

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

the class TestSetFlatteningOptimizer method assertPlan.

@Override
protected void assertPlan(String sql, PlanMatchPattern pattern) {
    List<PlanOptimizer> optimizers = ImmutableList.of(new UnaliasSymbolReferences(getQueryRunner().getMetadata()), new PruneUnreferencedOutputs(), new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getEstimatedExchangesCostCalculator(), ImmutableSet.of(new RemoveRedundantIdentityProjections())), new SetFlatteningOptimizer());
    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)

Example 4 with RemoveRedundantIdentityProjections

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

the class BasePlanTest method assertMinimallyOptimizedPlan.

protected void assertMinimallyOptimizedPlan(@Language("SQL") String sql, PlanMatchPattern pattern) {
    List<PlanOptimizer> optimizers = ImmutableList.of(new UnaliasSymbolReferences(queryRunner.getMetadata()), new PruneUnreferencedOutputs(), new IterativeOptimizer(new RuleStatsRecorder(), queryRunner.getStatsCalculator(), queryRunner.getCostCalculator(), ImmutableSet.of(new RemoveRedundantIdentityProjections())));
    assertPlan(sql, LogicalPlanner.Stage.OPTIMIZED, pattern, optimizers);
}
Also used : PlanOptimizer(io.prestosql.sql.planner.optimizations.PlanOptimizer) RuleStatsRecorder(io.prestosql.sql.planner.RuleStatsRecorder) RemoveRedundantIdentityProjections(io.prestosql.sql.planner.iterative.rule.RemoveRedundantIdentityProjections) PruneUnreferencedOutputs(io.prestosql.sql.planner.optimizations.PruneUnreferencedOutputs) IterativeOptimizer(io.prestosql.sql.planner.iterative.IterativeOptimizer) UnaliasSymbolReferences(io.prestosql.sql.planner.optimizations.UnaliasSymbolReferences)

Example 5 with RemoveRedundantIdentityProjections

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

Aggregations

RuleStatsRecorder (io.prestosql.sql.planner.RuleStatsRecorder)6 IterativeOptimizer (io.prestosql.sql.planner.iterative.IterativeOptimizer)6 RemoveRedundantIdentityProjections (io.prestosql.sql.planner.iterative.rule.RemoveRedundantIdentityProjections)6 TranslateExpressions (io.prestosql.sql.planner.iterative.rule.TranslateExpressions)3 TypeAnalyzer (io.prestosql.sql.planner.TypeAnalyzer)2 SqlParser (io.prestosql.sql.parser.SqlParser)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 PlanOptimizer (io.prestosql.sql.planner.optimizations.PlanOptimizer)1 PruneUnreferencedOutputs (io.prestosql.sql.planner.optimizations.PruneUnreferencedOutputs)1 UnaliasSymbolReferences (io.prestosql.sql.planner.optimizations.UnaliasSymbolReferences)1