Search in sources :

Example 16 with StatsProvider

use of com.facebook.presto.cost.StatsProvider in project presto by prestodb.

the class RuleAssert method formatPlan.

private String formatPlan(PlanNode plan, TypeProvider types) {
    StatsProvider statsProvider = new CachingStatsProvider(statsCalculator, session, types);
    CostProvider costProvider = new CachingCostProvider(costCalculator, statsProvider, session);
    return inTransaction(session -> textLogicalPlan(translateExpressions(plan, types), types, metadata.getFunctionAndTypeManager(), StatsAndCosts.create(plan, statsProvider, costProvider), session, 2, false));
}
Also used : CachingStatsProvider(com.facebook.presto.cost.CachingStatsProvider) CachingStatsProvider(com.facebook.presto.cost.CachingStatsProvider) StatsProvider(com.facebook.presto.cost.StatsProvider) CachingCostProvider(com.facebook.presto.cost.CachingCostProvider) CachingCostProvider(com.facebook.presto.cost.CachingCostProvider) CostProvider(com.facebook.presto.cost.CostProvider)

Aggregations

StatsProvider (com.facebook.presto.cost.StatsProvider)16 Metadata (com.facebook.presto.metadata.Metadata)8 PlanNode (com.facebook.presto.spi.plan.PlanNode)8 List (java.util.List)8 Session (com.facebook.presto.Session)7 NO_MATCH (com.facebook.presto.sql.planner.assertions.MatchResult.NO_MATCH)7 MoreObjects.toStringHelper (com.google.common.base.MoreObjects.toStringHelper)7 Preconditions.checkState (com.google.common.base.Preconditions.checkState)7 Objects.requireNonNull (java.util.Objects.requireNonNull)7 Optional (java.util.Optional)7 VariableReferenceExpression (com.facebook.presto.spi.relation.VariableReferenceExpression)6 MatchResult.match (com.facebook.presto.sql.planner.assertions.MatchResult.match)6 CachingStatsProvider (com.facebook.presto.cost.CachingStatsProvider)5 Symbol (com.facebook.presto.sql.planner.Symbol)5 CachingCostProvider (com.facebook.presto.cost.CachingCostProvider)4 CostProvider (com.facebook.presto.cost.CostProvider)4 ImmutableSet.toImmutableSet (com.google.common.collect.ImmutableSet.toImmutableSet)4 PlanMatchPattern.node (com.facebook.presto.sql.planner.assertions.PlanMatchPattern.node)3 JoinNode (com.facebook.presto.sql.planner.plan.JoinNode)3 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)3