Search in sources :

Example 1 with PlanChecker

use of com.facebook.presto.sql.planner.sanity.PlanChecker 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

CostCalculator (com.facebook.presto.cost.CostCalculator)1 CostCalculatorUsingExchanges (com.facebook.presto.cost.CostCalculatorUsingExchanges)1 CostCalculatorWithEstimatedExchanges (com.facebook.presto.cost.CostCalculatorWithEstimatedExchanges)1 CostComparator (com.facebook.presto.cost.CostComparator)1 TaskCountEstimator (com.facebook.presto.cost.TaskCountEstimator)1 QueryManagerConfig (com.facebook.presto.execution.QueryManagerConfig)1 Metadata (com.facebook.presto.metadata.Metadata)1 FeaturesConfig (com.facebook.presto.sql.analyzer.FeaturesConfig)1 QueryExplainer (com.facebook.presto.sql.analyzer.QueryExplainer)1 PartitioningProviderManager (com.facebook.presto.sql.planner.PartitioningProviderManager)1 PlanFragmenter (com.facebook.presto.sql.planner.PlanFragmenter)1 PlanOptimizers (com.facebook.presto.sql.planner.PlanOptimizers)1 PlanOptimizer (com.facebook.presto.sql.planner.optimizations.PlanOptimizer)1 PlanChecker (com.facebook.presto.sql.planner.sanity.PlanChecker)1 MBeanExporter (org.weakref.jmx.MBeanExporter)1 TestingMBeanServer (org.weakref.jmx.testing.TestingMBeanServer)1