use of io.prestosql.plugin.tpch.TpchPlugin in project hetu-core by openlookeng.
the class SqlServerQueryRunner method createSqlServerQueryRunner.
public static QueryRunner createSqlServerQueryRunner(TestingSqlServer testingSqlServer, Map<String, String> inputConnectorProperties, Iterable<TpchTable<?>> tables) throws Exception {
Map<String, String> connectorProperties = inputConnectorProperties;
DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(createSession()).build();
try {
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
connectorProperties = new HashMap<>(ImmutableMap.copyOf(connectorProperties));
connectorProperties.putIfAbsent("connection-url", testingSqlServer.getJdbcUrl());
connectorProperties.putIfAbsent("connection-user", TestingSqlServer.USER);
connectorProperties.putIfAbsent("connection-password", TestingSqlServer.PASSWORD);
connectorProperties.putIfAbsent("allow-drop-table", "true");
queryRunner.installPlugin(new SqlServerPlugin());
queryRunner.createCatalog(CATALOG, "sqlserver", connectorProperties);
provisionTables(createSession(), queryRunner, tables);
return queryRunner;
} catch (Throwable e) {
closeAllSuppress(e, queryRunner);
throw e;
}
}
use of io.prestosql.plugin.tpch.TpchPlugin in project hetu-core by openlookeng.
the class H2TestUtil method createQueryRunner.
public static DistributedQueryRunner createQueryRunner(String dbConfigUrl, H2ResourceGroupsDao dao, String environment) throws Exception {
DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(testSessionBuilder().setCatalog("tpch").setSchema("tiny").build()).setNodeCount(2).setEnvironment(environment).build();
try {
Plugin h2ResourceGroupManagerPlugin = new H2ResourceGroupManagerPlugin();
queryRunner.installPlugin(h2ResourceGroupManagerPlugin);
queryRunner.getCoordinator().getResourceGroupManager().get().setConfigurationManager(CONFIGURATION_MANAGER_TYPE, ImmutableMap.of("resource-groups.config-db-url", dbConfigUrl, "node.environment", environment));
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
setup(queryRunner, dao, environment);
return queryRunner;
} catch (Exception e) {
queryRunner.close();
throw e;
}
}
use of io.prestosql.plugin.tpch.TpchPlugin in project hetu-core by openlookeng.
the class TestFinalQueryInfo method createQueryRunner.
public static DistributedQueryRunner createQueryRunner(Session session) throws Exception {
DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(session).setNodeCount(2).build();
try {
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
return queryRunner;
} catch (Exception e) {
queryRunner.close();
throw e;
}
}
use of io.prestosql.plugin.tpch.TpchPlugin in project hetu-core by openlookeng.
the class TestQueryRunnerUtil method createQueryRunner.
public static DistributedQueryRunner createQueryRunner(Map<String, String> extraProperties) throws Exception {
DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(testSessionBuilder().build()).setExtraProperties(extraProperties).setNodeCount(2).build();
try {
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
return queryRunner;
} catch (Exception e) {
queryRunner.close();
throw e;
}
}
use of io.prestosql.plugin.tpch.TpchPlugin in project hetu-core by openlookeng.
the class TestCachedSqlQueryExecution method setupWithExecutionPlanCacheDisabled.
private void setupWithExecutionPlanCacheDisabled(Session session) throws Exception {
Map<String, String> properties = new HashMap<>();
properties.putIfAbsent("hetu.executionplan.cache.enabled", "false");
queryRunner = new DistributedQueryRunner(session, 1, properties);
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
}
Aggregations