use of io.trino.plugin.tpch.TpchPlugin in project trino by trinodb.
the class TestJdbcExternalAuthentication method setup.
@BeforeClass
public void setup() throws Exception {
Logging.initialize();
server = TestingTrinoServer.builder().setAdditionalModule(new DummyExternalAuthModule(() -> server.getAddress().getPort())).setProperties(ImmutableMap.<String, String>builder().put("http-server.authentication.type", "dummy-external").put("http-server.https.enabled", "true").put("http-server.https.keystore.path", new File(getResource("localhost.keystore").toURI()).getPath()).put("http-server.https.keystore.key", "changeit").put("web-ui.enabled", "false").buildOrThrow()).build();
server.installPlugin(new TpchPlugin());
server.createCatalog(TEST_CATALOG, "tpch");
server.waitForNodeRefresh(Duration.ofSeconds(10));
}
use of io.trino.plugin.tpch.TpchPlugin in project trino by trinodb.
the class TestTrinoDriver method setup.
@BeforeClass
public void setup() throws Exception {
Logging.initialize();
server = TestingTrinoServer.create();
server.installPlugin(new TpchPlugin());
server.createCatalog(TEST_CATALOG, "tpch");
server.installPlugin(new BlackHolePlugin());
server.createCatalog("blackhole", "blackhole");
server.waitForNodeRefresh(java.time.Duration.ofSeconds(10));
setupTestTables();
executorService = newCachedThreadPool(daemonThreadsNamed(getClass().getSimpleName() + "-%s"));
}
use of io.trino.plugin.tpch.TpchPlugin in project trino by trinodb.
the class TestTrinoDriverAuth method setup.
@BeforeClass
public void setup() throws Exception {
Logging.initialize();
URL resource = getClass().getClassLoader().getResource("33.privateKey");
assertNotNull(resource, "key directory not found");
File keyDir = new File(resource.getFile()).getAbsoluteFile().getParentFile();
defaultKey = hmacShaKeyFor(getMimeDecoder().decode(asCharSource(new File(keyDir, "default-key.key"), US_ASCII).read().getBytes(US_ASCII)));
hmac222 = hmacShaKeyFor(getMimeDecoder().decode(asCharSource(new File(keyDir, "222.key"), US_ASCII).read().getBytes(US_ASCII)));
privateKey33 = PemReader.loadPrivateKey(new File(keyDir, "33.privateKey"), Optional.empty());
server = TestingTrinoServer.builder().setProperties(ImmutableMap.<String, String>builder().put("http-server.authentication.type", "JWT").put("http-server.authentication.jwt.key-file", new File(keyDir, "${KID}.key").getPath()).put("http-server.https.enabled", "true").put("http-server.https.keystore.path", new File(getResource("localhost.keystore").toURI()).getPath()).put("http-server.https.keystore.key", "changeit").buildOrThrow()).build();
server.installPlugin(new TpchPlugin());
server.createCatalog(TEST_CATALOG, "tpch");
server.waitForNodeRefresh(Duration.ofSeconds(10));
}
use of io.trino.plugin.tpch.TpchPlugin in project trino by trinodb.
the class CassandraQueryRunner method createCassandraQueryRunner.
public static DistributedQueryRunner createCassandraQueryRunner(CassandraServer server, Map<String, String> extraProperties, Iterable<TpchTable<?>> tables) throws Exception {
DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(createCassandraSession("tpch")).setExtraProperties(extraProperties).build();
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
queryRunner.installPlugin(new CassandraPlugin());
queryRunner.createCatalog("cassandra", "cassandra", ImmutableMap.of("cassandra.contact-points", server.getHost(), "cassandra.native-protocol-port", Integer.toString(server.getPort()), "cassandra.allow-drop-table", "true"));
createKeyspace(server.getSession(), "tpch");
copyTpchTables(queryRunner, "tpch", TINY_SCHEMA_NAME, createCassandraSession("tpch"), tables);
for (TpchTable<?> table : tables) {
server.refreshSizeEstimates("tpch", table.getTableName());
}
return queryRunner;
}
use of io.trino.plugin.tpch.TpchPlugin in project trino by trinodb.
the class ScyllaQueryRunner method createScyllaQueryRunner.
public static DistributedQueryRunner createScyllaQueryRunner(TestingScyllaServer server, Map<String, String> extraProperties, Map<String, String> connectorProperties, Iterable<TpchTable<?>> tables) throws Exception {
DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(createSession("tpch")).setExtraProperties(extraProperties).build();
try {
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
connectorProperties = new HashMap<>(ImmutableMap.copyOf(connectorProperties));
connectorProperties.putIfAbsent("cassandra.contact-points", server.getHost());
connectorProperties.putIfAbsent("cassandra.native-protocol-port", Integer.toString(server.getPort()));
connectorProperties.putIfAbsent("cassandra.allow-drop-table", "true");
queryRunner.installPlugin(new CassandraPlugin());
queryRunner.createCatalog("cassandra", "cassandra", connectorProperties);
createKeyspace(server.getSession(), "tpch");
copyTpchTables(queryRunner, "tpch", TINY_SCHEMA_NAME, createSession("tpch"), tables);
for (TpchTable<?> table : tables) {
server.refreshSizeEstimates("tpch", table.getTableName());
}
return queryRunner;
} catch (Throwable e) {
closeAllSuppress(e, queryRunner);
throw e;
}
}
Aggregations