Search in sources :

Example 6 with PartitioningProviderManager

use of com.facebook.presto.sql.planner.PartitioningProviderManager in project presto by prestodb.

the class TestEliminateSorts method assertUnitPlan.

public void assertUnitPlan(@Language("SQL") String sql, PlanMatchPattern pattern) {
    List<PlanOptimizer> optimizers = ImmutableList.of(new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getCostCalculator(), new TranslateExpressions(getMetadata(), new SqlParser()).rules()), new AddExchanges(getQueryRunner().getMetadata(), new SqlParser(), new PartitioningProviderManager()), new UnaliasSymbolReferences(getMetadata().getFunctionAndTypeManager()), new PruneUnreferencedOutputs(), new IterativeOptimizer(new RuleStatsRecorder(), getQueryRunner().getStatsCalculator(), getQueryRunner().getCostCalculator(), ImmutableSet.of(new RemoveRedundantIdentityProjections())));
    assertPlan(sql, pattern, optimizers);
}
Also used : RuleStatsRecorder(com.facebook.presto.sql.planner.RuleStatsRecorder) RemoveRedundantIdentityProjections(com.facebook.presto.sql.planner.iterative.rule.RemoveRedundantIdentityProjections) PartitioningProviderManager(com.facebook.presto.sql.planner.PartitioningProviderManager) IterativeOptimizer(com.facebook.presto.sql.planner.iterative.IterativeOptimizer) SqlParser(com.facebook.presto.sql.parser.SqlParser) TranslateExpressions(com.facebook.presto.sql.planner.iterative.rule.TranslateExpressions)

Example 7 with PartitioningProviderManager

use of com.facebook.presto.sql.planner.PartitioningProviderManager in project presto by prestodb.

the class AbstractTestQueryFramework method getQueryExplainer.

private QueryExplainer getQueryExplainer() {
    Metadata metadata = queryRunner.getMetadata();
    FeaturesConfig featuresConfig = new FeaturesConfig().setOptimizeHashGeneration(true);
    boolean forceSingleNode = queryRunner.getNodeCount() == 1;
    TaskCountEstimator taskCountEstimator = new TaskCountEstimator(queryRunner::getNodeCount);
    CostCalculator costCalculator = new CostCalculatorUsingExchanges(taskCountEstimator);
    List<PlanOptimizer> optimizers = new PlanOptimizers(metadata, sqlParser, forceSingleNode, new MBeanExporter(new TestingMBeanServer()), queryRunner.getSplitManager(), queryRunner.getPlanOptimizerManager(), queryRunner.getPageSourceManager(), queryRunner.getStatsCalculator(), costCalculator, new CostCalculatorWithEstimatedExchanges(costCalculator, taskCountEstimator), new CostComparator(featuresConfig), taskCountEstimator, new PartitioningProviderManager()).getPlanningTimeOptimizers();
    return new QueryExplainer(optimizers, new PlanFragmenter(metadata, queryRunner.getNodePartitioningManager(), new QueryManagerConfig(), sqlParser, new FeaturesConfig()), metadata, queryRunner.getAccessControl(), sqlParser, queryRunner.getStatsCalculator(), costCalculator, ImmutableMap.of(), new PlanChecker(new FeaturesConfig(), false));
}
Also used : TaskCountEstimator(com.facebook.presto.cost.TaskCountEstimator) CostComparator(com.facebook.presto.cost.CostComparator) PlanOptimizer(com.facebook.presto.sql.planner.optimizations.PlanOptimizer) TestingMBeanServer(org.weakref.jmx.testing.TestingMBeanServer) QueryExplainer(com.facebook.presto.sql.analyzer.QueryExplainer) FeaturesConfig(com.facebook.presto.sql.analyzer.FeaturesConfig) MBeanExporter(org.weakref.jmx.MBeanExporter) PartitioningProviderManager(com.facebook.presto.sql.planner.PartitioningProviderManager) Metadata(com.facebook.presto.metadata.Metadata) PlanFragmenter(com.facebook.presto.sql.planner.PlanFragmenter) CostCalculator(com.facebook.presto.cost.CostCalculator) PlanChecker(com.facebook.presto.sql.planner.sanity.PlanChecker) PlanOptimizers(com.facebook.presto.sql.planner.PlanOptimizers) QueryManagerConfig(com.facebook.presto.execution.QueryManagerConfig) CostCalculatorUsingExchanges(com.facebook.presto.cost.CostCalculatorUsingExchanges) CostCalculatorWithEstimatedExchanges(com.facebook.presto.cost.CostCalculatorWithEstimatedExchanges)

Aggregations

PartitioningProviderManager (com.facebook.presto.sql.planner.PartitioningProviderManager)7 NoOpQueryManager (com.facebook.presto.dispatcher.NoOpQueryManager)2 QueryManagerConfig (com.facebook.presto.execution.QueryManagerConfig)2 LegacyNetworkTopology (com.facebook.presto.execution.scheduler.LegacyNetworkTopology)2 NodeScheduler (com.facebook.presto.execution.scheduler.NodeScheduler)2 NodeSchedulerConfig (com.facebook.presto.execution.scheduler.NodeSchedulerConfig)2 NodeSelectionStats (com.facebook.presto.execution.scheduler.nodeSelection.NodeSelectionStats)2 SimpleTtlNodeSelectorConfig (com.facebook.presto.execution.scheduler.nodeSelection.SimpleTtlNodeSelectorConfig)2 InMemoryNodeManager (com.facebook.presto.metadata.InMemoryNodeManager)2 ConnectorId (com.facebook.presto.spi.ConnectorId)2 ConnectorTransactionHandle (com.facebook.presto.spi.connector.ConnectorTransactionHandle)2 FeaturesConfig (com.facebook.presto.sql.analyzer.FeaturesConfig)2 SqlParser (com.facebook.presto.sql.parser.SqlParser)2 PlanFragmenter (com.facebook.presto.sql.planner.PlanFragmenter)2 ImmutableList (com.google.common.collect.ImmutableList)2 List (java.util.List)2 JsonCodec.jsonCodec (com.facebook.airlift.json.JsonCodec.jsonCodec)1 JsonObjectMapperProvider (com.facebook.airlift.json.JsonObjectMapperProvider)1 Session (com.facebook.presto.Session)1 TEST_SESSION (com.facebook.presto.SessionTestUtils.TEST_SESSION)1