use of io.trino.plugin.thrift.ThriftPlugin in project trino by trinodb.
the class ThriftQueryRunner method createThriftQueryRunnerInternal.
private static DistributedQueryRunner createThriftQueryRunnerInternal(List<DriftServer> servers, Map<String, String> properties) throws Exception {
String addresses = servers.stream().map(server -> "localhost:" + driftServerPort(server)).collect(joining(","));
Session defaultSession = testSessionBuilder().setCatalog("thrift").setSchema("tiny").build();
DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(defaultSession).setExtraProperties(properties).build();
queryRunner.installPlugin(new ThriftPlugin());
Map<String, String> connectorProperties = ImmutableMap.<String, String>builder().put("trino.thrift.client.addresses", addresses).put("trino.thrift.client.connect-timeout", "30s").put("trino-thrift.lookup-requests-concurrency", "2").buildOrThrow();
queryRunner.createCatalog("thrift", "trino-thrift", connectorProperties);
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
return queryRunner;
}
use of io.trino.plugin.thrift.ThriftPlugin in project trino by trinodb.
the class TestThriftProjectionPushdown method createLocalQueryRunner.
@Override
protected Optional<LocalQueryRunner> createLocalQueryRunner() {
try {
servers = startThriftServers(1, false);
} catch (Throwable t) {
try {
cleanup();
} catch (Throwable e) {
t.addSuppressed(e);
}
throw t;
}
String addresses = servers.stream().map(server -> "localhost:" + driftServerPort(server)).collect(joining(","));
Map<String, String> connectorProperties = ImmutableMap.<String, String>builder().put("trino.thrift.client.addresses", addresses).put("trino.thrift.client.connect-timeout", "30s").put("trino-thrift.lookup-requests-concurrency", "2").buildOrThrow();
LocalQueryRunner runner = LocalQueryRunner.create(SESSION);
runner.createCatalog(CATALOG, getOnlyElement(new ThriftPlugin().getConnectorFactories()), connectorProperties);
return Optional.of(runner);
}
Aggregations