use of io.prestosql.execution.SqlQueryManager in project hetu-core by openlookeng.
the class TestCachedSqlQueryExecution method testExecutionPlanCacheDisabled.
@Test
public void testExecutionPlanCacheDisabled() throws Exception {
setupWithExecutionPlanCacheDisabled(TPCH_SESSION);
SqlQueryManager manager = (SqlQueryManager) queryRunner.getCoordinator().getQueryManager();
Plan plan1 = getPlan(TEST_SQL, manager);
Plan plan2 = getPlan(TEST_SQL, manager);
assertNotSame(plan1.getStatsAndCosts(), plan2.getStatsAndCosts());
}
use of io.prestosql.execution.SqlQueryManager in project hetu-core by openlookeng.
the class TestCachedSqlQueryExecution method testExecutionPlanCacheEnabledMulti.
@Test
public void testExecutionPlanCacheEnabledMulti() throws Exception {
setupWithExecutionPlanCacheEnabled(TPCH_SESSION);
SqlQueryManager manager = (SqlQueryManager) queryRunner.getCoordinator().getQueryManager();
Plan plan1 = getPlan(TEST_SQL, manager);
Plan plan2 = getPlan(TEST_SQL, manager);
Plan plan3 = getPlan(TEST_SQL, manager);
Plan plan4 = getPlan(TEST_SQL, manager);
assertSame(plan1.getStatsAndCosts(), plan2.getStatsAndCosts());
assertSame(plan2.getStatsAndCosts(), plan3.getStatsAndCosts());
assertSame(plan3.getStatsAndCosts(), plan4.getStatsAndCosts());
}
use of io.prestosql.execution.SqlQueryManager in project hetu-core by openlookeng.
the class TestCachedSqlQueryExecution method testExecutionPlanCacheWithFunctions.
@Test
public void testExecutionPlanCacheWithFunctions() throws Exception {
setupWithExecutionPlanCacheEnabled(TPCH_SESSION);
SqlQueryManager manager = (SqlQueryManager) queryRunner.getCoordinator().getQueryManager();
String query = "EXPLAIN SELECT * FROM orders";
Plan plan1 = getPlan(TEST_SQL, manager);
Plan plan2 = getPlan(query, manager);
Plan plan3 = getPlan(TEST_SQL, manager);
Plan plan4 = getPlan(TEST_SQL, manager);
assertNotSame(plan1.getStatsAndCosts(), plan2.getStatsAndCosts());
assertSame(plan1.getStatsAndCosts(), plan3.getStatsAndCosts());
assertSame(plan3.getStatsAndCosts(), plan4.getStatsAndCosts());
}
use of io.prestosql.execution.SqlQueryManager in project hetu-core by openlookeng.
the class TestCachedSqlQueryExecution method testCreateTable.
@Test
public void testCreateTable() throws Exception {
setupWithExecutionPlanCacheEnabled(DEFAULT_SESSION);
TestingMetadata metadata = new TestingMetadata();
queryRunner.installPlugin(new TestPlugin(metadata));
queryRunner.createCatalog("test", "test");
SqlQueryManager manager = (SqlQueryManager) queryRunner.getCoordinator().getQueryManager();
String query1 = "CREATE TABLE nation AS SELECT * FROM tpch.tiny.nation";
String query2 = "SELECT * FROM nation";
String query3 = "SELECT * FROM tpch.tiny.nation";
String query4 = "SELECT COUNT(*) FROM tpch.tiny.orders";
Plan plan1 = getPlan(query1, manager);
Plan plan2 = getPlan(query2, manager);
Plan plan3 = getPlan(query3, manager);
Plan plan4 = getPlan(query4, manager);
assertNotNull(plan1);
assertNotNull(plan2);
assertNotNull(plan4);
assertNotSame(plan2.getStatsAndCosts(), plan3.getStatsAndCosts());
}
use of io.prestosql.execution.SqlQueryManager in project hetu-core by openlookeng.
the class TestCachedSqlQueryExecution method testExecutionPlanCacheNestedStatementsWithCurrentTime.
@Test
public void testExecutionPlanCacheNestedStatementsWithCurrentTime() throws Exception {
setupWithExecutionPlanCacheEnabled(TPCH_SESSION);
SqlQueryManager manager = (SqlQueryManager) queryRunner.getCoordinator().getQueryManager();
String testSql = "SELECT 5, COUNT(*) FROM (SELECT CURRENT_TIME, * FROM tpch.tiny.orders GROUP BY clerk, orderkey, custkey, totalprice, orderstatus, orderdate, orderpriority, shippriority, comment) WHERE TOTALPRICE > 1";
Plan plan1 = getPlan(testSql, manager);
Plan plan2 = getPlan(testSql, manager);
assertNotSame(plan1.getStatsAndCosts(), plan2.getStatsAndCosts());
}
Aggregations