Search in sources :

Example 1 with TaskManagerConfig

use of io.prestosql.execution.TaskManagerConfig in project hetu-core by openlookeng.

the class TestAnalyzer method testTooManyGroupingElements.

@Test
public void testTooManyGroupingElements() {
    Session session = testSessionBuilder(new SessionPropertyManager(new SystemSessionProperties(new QueryManagerConfig(), new TaskManagerConfig(), new MemoryManagerConfig(), new FeaturesConfig().setMaxGroupingSets(2048), new HetuConfig(), new SnapshotConfig()))).build();
    analyze(session, "SELECT a, b, c, d, e, f, g, h, i, j, k, SUM(l)" + "FROM (VALUES (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))\n" + "t (a, b, c, d, e, f, g, h, i, j, k, l)\n" + "GROUP BY CUBE (a, b, c, d, e, f), CUBE (g, h, i, j, k)");
    assertFails(session, TOO_MANY_GROUPING_SETS, "line 3:10: GROUP BY has 4096 grouping sets but can contain at most 2048", "SELECT a, b, c, d, e, f, g, h, i, j, k, l, SUM(m)" + "FROM (VALUES (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13))\n" + "t (a, b, c, d, e, f, g, h, i, j, k, l, m)\n" + "GROUP BY CUBE (a, b, c, d, e, f), CUBE (g, h, i, j, k, l)");
    assertFails(session, TOO_MANY_GROUPING_SETS, format("line 3:10: GROUP BY has more than %s grouping sets but can contain at most 2048", Integer.MAX_VALUE), "SELECT a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, " + "q, r, s, t, u, v, x, w, y, z, aa, ab, ac, ad, ae, SUM(af)" + "FROM (VALUES (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, " + "17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32))\n" + "t (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, " + "q, r, s, t, u, v, x, w, y, z, aa, ab, ac, ad, ae, af)\n" + "GROUP BY CUBE (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, " + "q, r, s, t, u, v, x, w, y, z, aa, ab, ac, ad, ae)");
}
Also used : SnapshotConfig(io.prestosql.snapshot.SnapshotConfig) SessionPropertyManager(io.prestosql.metadata.SessionPropertyManager) QueryManagerConfig(io.prestosql.execution.QueryManagerConfig) TaskManagerConfig(io.prestosql.execution.TaskManagerConfig) MemoryManagerConfig(io.prestosql.memory.MemoryManagerConfig) HetuConfig(io.prestosql.utils.HetuConfig) Session(io.prestosql.Session) SystemSessionProperties(io.prestosql.SystemSessionProperties) Test(org.testng.annotations.Test)

Example 2 with TaskManagerConfig

use of io.prestosql.execution.TaskManagerConfig in project hetu-core by openlookeng.

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);
    HetuMetaStoreManager hetuMetaStoreManager = new HetuMetaStoreManager();
    List<PlanOptimizer> optimizers = new PlanOptimizers(metadata, new TypeAnalyzer(sqlParser, metadata), featuresConfig, new TaskManagerConfig(), forceSingleNode, new MBeanExporter(new TestingMBeanServer()), queryRunner.getSplitManager(), queryRunner.getPlanOptimizerManager(), queryRunner.getPageSourceManager(), queryRunner.getStatsCalculator(), costCalculator, new CostCalculatorWithEstimatedExchanges(costCalculator, taskCountEstimator), new CostComparator(featuresConfig), taskCountEstimator, new CubeManager(featuresConfig, hetuMetaStoreManager)).get();
    return new QueryExplainer(optimizers, new PlanFragmenter(metadata, queryRunner.getNodePartitioningManager(), new QueryManagerConfig()), metadata, queryRunner.getAccessControl(), sqlParser, queryRunner.getStatsCalculator(), costCalculator, ImmutableMap.of(), new HeuristicIndexerManager(null, null), new CubeManager(featuresConfig, hetuMetaStoreManager));
}
Also used : TaskCountEstimator(io.prestosql.cost.TaskCountEstimator) CostComparator(io.prestosql.cost.CostComparator) PlanOptimizer(io.prestosql.sql.planner.optimizations.PlanOptimizer) TestingMBeanServer(org.weakref.jmx.testing.TestingMBeanServer) QueryExplainer(io.prestosql.sql.analyzer.QueryExplainer) FeaturesConfig(io.prestosql.sql.analyzer.FeaturesConfig) MBeanExporter(org.weakref.jmx.MBeanExporter) HeuristicIndexerManager(io.prestosql.heuristicindex.HeuristicIndexerManager) Metadata(io.prestosql.metadata.Metadata) PlanFragmenter(io.prestosql.sql.planner.PlanFragmenter) TaskManagerConfig(io.prestosql.execution.TaskManagerConfig) TypeAnalyzer(io.prestosql.sql.planner.TypeAnalyzer) CubeManager(io.prestosql.cube.CubeManager) CostCalculator(io.prestosql.cost.CostCalculator) PlanOptimizers(io.prestosql.sql.planner.PlanOptimizers) QueryManagerConfig(io.prestosql.execution.QueryManagerConfig) CostCalculatorUsingExchanges(io.prestosql.cost.CostCalculatorUsingExchanges) CostCalculatorWithEstimatedExchanges(io.prestosql.cost.CostCalculatorWithEstimatedExchanges) HetuMetaStoreManager(io.prestosql.metastore.HetuMetaStoreManager)

Aggregations

QueryManagerConfig (io.prestosql.execution.QueryManagerConfig)2 TaskManagerConfig (io.prestosql.execution.TaskManagerConfig)2 Session (io.prestosql.Session)1 SystemSessionProperties (io.prestosql.SystemSessionProperties)1 CostCalculator (io.prestosql.cost.CostCalculator)1 CostCalculatorUsingExchanges (io.prestosql.cost.CostCalculatorUsingExchanges)1 CostCalculatorWithEstimatedExchanges (io.prestosql.cost.CostCalculatorWithEstimatedExchanges)1 CostComparator (io.prestosql.cost.CostComparator)1 TaskCountEstimator (io.prestosql.cost.TaskCountEstimator)1 CubeManager (io.prestosql.cube.CubeManager)1 HeuristicIndexerManager (io.prestosql.heuristicindex.HeuristicIndexerManager)1 MemoryManagerConfig (io.prestosql.memory.MemoryManagerConfig)1 Metadata (io.prestosql.metadata.Metadata)1 SessionPropertyManager (io.prestosql.metadata.SessionPropertyManager)1 HetuMetaStoreManager (io.prestosql.metastore.HetuMetaStoreManager)1 SnapshotConfig (io.prestosql.snapshot.SnapshotConfig)1 FeaturesConfig (io.prestosql.sql.analyzer.FeaturesConfig)1 QueryExplainer (io.prestosql.sql.analyzer.QueryExplainer)1 PlanFragmenter (io.prestosql.sql.planner.PlanFragmenter)1 PlanOptimizers (io.prestosql.sql.planner.PlanOptimizers)1