use of io.prestosql.plugin.tpch.TpchPlugin in project hetu-core by openlookeng.
the class TestCachedSqlQueryExecution method setupWithExecutionPlanCacheEnabled.
private void setupWithExecutionPlanCacheEnabled(Session session) throws Exception {
Map<String, String> properties = new HashMap<>();
properties.putIfAbsent("hetu.executionplan.cache.enabled", "true");
properties.putIfAbsent("hetu.executionplan.cache.limit", "2");
properties.putIfAbsent("hetu.executionplan.cache.timeout", "60000");
if (queryRunner != null) {
queryRunner.close();
}
queryRunner = new DistributedQueryRunner(session, 1, properties);
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
}
use of io.prestosql.plugin.tpch.TpchPlugin in project hetu-core by openlookeng.
the class TestDataCenterClient method setup.
/**
* setup
*
* @throws Exception setup failed.
*/
@BeforeClass
public void setup() throws Exception {
this.server = new TestingPrestoServer();
this.baseUri = server.getBaseUrl();
this.server.installPlugin(new TpchPlugin());
this.server.createCatalog("tpch", "tpch");
this.config = new DataCenterConfig().setConnectionUrl(this.baseUri).setConnectionUser("root");
this.httpClient = DataCenterStatementClientFactory.newHttpClient(this.config);
}
use of io.prestosql.plugin.tpch.TpchPlugin in project hetu-core by openlookeng.
the class DataCenterQueryRunner method createDCQueryRunner.
static QueryRunner createDCQueryRunner(TestingPrestoServer hetuServer, Map<String, String> properties, Iterable<TpchTable<?>> tables) throws Exception {
hetuServer.installPlugin(new TpchPlugin());
hetuServer.createCatalog("tpch", "tpch");
DistributedQueryRunner queryRunner = null;
try {
DistributedQueryRunner.Builder builder = DistributedQueryRunner.builder(createSession());
queryRunner = builder.build();
Map<String, String> connectorProperties = new HashMap<>(properties);
connectorProperties.putIfAbsent("connection-url", hetuServer.getBaseUrl().toString());
connectorProperties.putIfAbsent("connection-user", "root");
queryRunner.installPlugin(new DataCenterPlugin());
queryRunner.createDCCatalog("dc", "dc", connectorProperties);
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch", properties);
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 GreenPlumQueryRunner method createGreenPlumQueryRunner.
public static QueryRunner createGreenPlumQueryRunner(TestingPostgreSqlServer server, Map<String, String> connectorProperties, Iterable<TpchTable<?>> tables) throws Exception {
DistributedQueryRunner queryRunner = null;
try {
queryRunner = new DistributedQueryRunner(createSession(), 3);
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
Map<String, String> connectorPropertiesMap = new HashMap<>(ImmutableMap.copyOf(connectorProperties));
connectorPropertiesMap.putIfAbsent("connection-url", server.getJdbcUrl());
connectorPropertiesMap.putIfAbsent("allow-drop-table", "true");
connectorPropertiesMap.putIfAbsent("jdbc.pushdown-enabled", "false");
createSchema(server.getJdbcUrl(), "tpch");
queryRunner.installPlugin(new GreenPlumSqlPlugin());
queryRunner.createCatalog(GREENPLUM_CONNECTOR_NAME, GREENPLUM_CONNECTOR_NAME, connectorPropertiesMap);
copyTpchTables(queryRunner, "tpch", TINY_SCHEMA_NAME, createSession(), tables);
return queryRunner;
} catch (Throwable e) {
closeAllSuppress(e, queryRunner, server);
throw e;
}
}
use of io.prestosql.plugin.tpch.TpchPlugin in project hetu-core by openlookeng.
the class JdbcQueryRunner method createJdbcQueryRunner.
public static DistributedQueryRunner createJdbcQueryRunner(Iterable<TpchTable<?>> tables) throws Exception {
DistributedQueryRunner queryRunner = null;
try {
queryRunner = new DistributedQueryRunner(createSession(), 3);
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
Map<String, String> properties = TestingH2JdbcModule.createProperties();
createSchema(properties, "tpch");
queryRunner.installPlugin(new JdbcPlugin("base-jdbc", new TestingH2JdbcModule()));
queryRunner.createCatalog("jdbc", "base-jdbc", properties);
copyTpchTables(queryRunner, "tpch", TINY_SCHEMA_NAME, createSession(), tables);
return queryRunner;
} catch (Throwable e) {
closeAllSuppress(e, queryRunner);
throw e;
}
}
Aggregations