use of io.trino.plugin.tpch.TpchPlugin in project trino by trinodb.
the class MongoQueryRunner method createMongoQueryRunner.
public static DistributedQueryRunner createMongoQueryRunner(MongoServer server, Map<String, String> extraProperties, Iterable<TpchTable<?>> tables) throws Exception {
DistributedQueryRunner queryRunner = null;
try {
queryRunner = DistributedQueryRunner.builder(createSession()).setExtraProperties(extraProperties).build();
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
Map<String, String> properties = ImmutableMap.of("mongodb.case-insensitive-name-matching", "true", "mongodb.connection-url", server.getConnectionString().toString());
queryRunner.installPlugin(new MongoPlugin());
queryRunner.createCatalog("mongodb", "mongodb", properties);
copyTpchTables(queryRunner, "tpch", TINY_SCHEMA_NAME, createSession(), tables);
return queryRunner;
} catch (Throwable e) {
closeAllSuppress(e, queryRunner);
throw e;
}
}
use of io.trino.plugin.tpch.TpchPlugin in project trino by trinodb.
the class TestRaptorMySqlConnectorTest method createRaptorMySqlQueryRunner.
private static QueryRunner createRaptorMySqlQueryRunner(String mysqlUrl) throws Exception {
DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(createSession("tpch")).build();
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
queryRunner.installPlugin(new RaptorPlugin());
File baseDir = queryRunner.getCoordinator().getBaseDataDir().toFile();
Map<String, String> raptorProperties = ImmutableMap.<String, String>builder().put("metadata.db.type", "mysql").put("metadata.db.url", mysqlUrl).put("storage.data-directory", new File(baseDir, "data").getAbsolutePath()).put("storage.max-shard-rows", "2000").put("backup.provider", "file").put("backup.directory", new File(baseDir, "backup").getAbsolutePath()).buildOrThrow();
queryRunner.createCatalog("raptor", "raptor-legacy", raptorProperties);
copyTables(queryRunner, "tpch", createSession(), false, REQUIRED_TPCH_TABLES);
return queryRunner;
}
use of io.trino.plugin.tpch.TpchPlugin in project trino by trinodb.
the class PhoenixQueryRunner method createPhoenixQueryRunner.
public static DistributedQueryRunner createPhoenixQueryRunner(TestingPhoenixServer server, Map<String, String> extraProperties, List<TpchTable<?>> tables) throws Exception {
DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(createSession()).setExtraProperties(extraProperties).build();
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
Map<String, String> properties = ImmutableMap.<String, String>builder().put("phoenix.connection-url", server.getJdbcUrl()).put("case-insensitive-name-matching", "true").buildOrThrow();
queryRunner.installPlugin(new PhoenixPlugin());
queryRunner.createCatalog("phoenix", "phoenix", properties);
if (!server.isTpchLoaded()) {
createSchema(server, TPCH_SCHEMA);
copyTpchTables(queryRunner, "tpch", TINY_SCHEMA_NAME, createSession(), tables);
server.setTpchLoaded();
} else {
server.waitTpchLoaded();
}
return queryRunner;
}
use of io.trino.plugin.tpch.TpchPlugin in project trino by trinodb.
the class KuduQueryRunnerFactory method createKuduQueryRunnerTpch.
public static QueryRunner createKuduQueryRunnerTpch(TestingKuduServer kuduServer, Optional<String> kuduSchemaEmulationPrefix, Map<String, String> kuduSessionProperties, Map<String, String> extraProperties, Iterable<TpchTable<?>> tables) throws Exception {
DistributedQueryRunner runner = null;
try {
String kuduSchema = kuduSchemaEmulationPrefix.isPresent() ? "tpch" : "default";
Session session = createSession(kuduSchema, kuduSessionProperties);
runner = DistributedQueryRunner.builder(session).setExtraProperties(extraProperties).build();
runner.installPlugin(new TpchPlugin());
runner.createCatalog("tpch", "tpch");
installKuduConnector(kuduServer.getMasterAddress(), runner, kuduSchema, kuduSchemaEmulationPrefix);
copyTpchTables(runner, "tpch", TINY_SCHEMA_NAME, session, tables);
return runner;
} catch (Throwable e) {
closeAllSuppress(e, runner);
throw e;
}
}
use of io.trino.plugin.tpch.TpchPlugin in project trino by trinodb.
the class PostgreSqlQueryRunner method createPostgreSqlQueryRunner.
public static DistributedQueryRunner createPostgreSqlQueryRunner(TestingPostgreSqlServer server, Map<String, String> extraProperties, Map<String, String> connectorProperties, Iterable<TpchTable<?>> tables) throws Exception {
DistributedQueryRunner queryRunner = null;
try {
queryRunner = DistributedQueryRunner.builder(createSession()).setExtraProperties(extraProperties).build();
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
connectorProperties = new HashMap<>(ImmutableMap.copyOf(connectorProperties));
connectorProperties.putIfAbsent("connection-url", server.getJdbcUrl());
connectorProperties.putIfAbsent("connection-user", server.getUser());
connectorProperties.putIfAbsent("connection-password", server.getPassword());
connectorProperties.putIfAbsent("postgresql.include-system-tables", "true");
// connectorProperties.putIfAbsent("postgresql.experimental.enable-string-pushdown-with-collate", "true");
queryRunner.installPlugin(new PostgreSqlPlugin());
queryRunner.createCatalog("postgresql", "postgresql", connectorProperties);
copyTpchTables(queryRunner, "tpch", TINY_SCHEMA_NAME, createSession(), tables);
return queryRunner;
} catch (Throwable e) {
closeAllSuppress(e, queryRunner, server);
throw e;
}
}
Aggregations