use of com.facebook.presto.tpch.TpchPlugin in project presto by prestodb.
the class MongoQueryRunner method createMongoQueryRunner.
public static MongoQueryRunner createMongoQueryRunner(Iterable<TpchTable<?>> tables) throws Exception {
MongoQueryRunner queryRunner = null;
try {
queryRunner = new MongoQueryRunner(createSession(), 3);
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
Map<String, String> properties = ImmutableMap.of("mongodb.seeds", queryRunner.getAddress().getHostString() + ":" + queryRunner.getAddress().getPort(), "mongodb.socket-keep-alive", "true");
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 com.facebook.presto.tpch.TpchPlugin in project presto by prestodb.
the class MemoryQueryRunner method createQueryRunner.
public static DistributedQueryRunner createQueryRunner(Map<String, String> extraProperties) throws Exception {
Session session = testSessionBuilder().setCatalog("memory").setSchema("default").build();
DistributedQueryRunner queryRunner = new DistributedQueryRunner(session, 4, extraProperties);
try {
queryRunner.installPlugin(new MemoryPlugin());
queryRunner.createCatalog("memory", "memory", ImmutableMap.of());
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch", ImmutableMap.of());
copyTpchTables(queryRunner, "tpch", TINY_SCHEMA_NAME, session, TpchTable.getTables());
return queryRunner;
} catch (Exception e) {
closeAllSuppress(e, queryRunner);
throw e;
}
}
use of com.facebook.presto.tpch.TpchPlugin in project presto by prestodb.
the class PostgreSqlQueryRunner method createPostgreSqlQueryRunner.
public static QueryRunner createPostgreSqlQueryRunner(TestingPostgreSqlServer server, 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 = ImmutableMap.<String, String>builder().put("connection-url", server.getJdbcUrl()).put("allow-drop-table", "true").build();
createSchema(server.getJdbcUrl(), "tpch");
queryRunner.installPlugin(new PostgreSqlPlugin());
queryRunner.createCatalog("postgresql", "postgresql", properties);
copyTpchTables(queryRunner, "tpch", TINY_SCHEMA_NAME, createSession(), tables);
return queryRunner;
} catch (Throwable e) {
closeAllSuppress(e, queryRunner, server);
throw e;
}
}
use of com.facebook.presto.tpch.TpchPlugin in project presto by prestodb.
the class TestRaptorIntegrationSmokeTestMySql method createRaptorMySqlQueryRunner.
private static DistributedQueryRunner createRaptorMySqlQueryRunner(TestingMySqlServer server) throws Exception {
DistributedQueryRunner queryRunner = new DistributedQueryRunner(createSession("tpch"), 2);
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", jdbcUrl(server)).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()).build();
queryRunner.createCatalog("raptor", "raptor", raptorProperties);
copyTables(queryRunner, "tpch", createSession(), false);
return queryRunner;
}
use of com.facebook.presto.tpch.TpchPlugin in project presto by prestodb.
the class KafkaQueryRunner method createKafkaQueryRunner.
public static DistributedQueryRunner createKafkaQueryRunner(EmbeddedKafka embeddedKafka, Iterable<TpchTable<?>> tables) throws Exception {
DistributedQueryRunner queryRunner = null;
try {
queryRunner = new DistributedQueryRunner(createSession(), 2);
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
embeddedKafka.start();
for (TpchTable<?> table : tables) {
embeddedKafka.createTopics(kafkaTopicName(table));
}
Map<SchemaTableName, KafkaTopicDescription> topicDescriptions = createTpchTopicDescriptions(queryRunner.getCoordinator().getMetadata(), tables);
installKafkaPlugin(embeddedKafka, queryRunner, topicDescriptions);
TestingPrestoClient prestoClient = queryRunner.getClient();
log.info("Loading data...");
long startTime = System.nanoTime();
for (TpchTable<?> table : tables) {
loadTpchTopic(embeddedKafka, prestoClient, table);
}
log.info("Loading complete in %s", nanosSince(startTime).toString(SECONDS));
return queryRunner;
} catch (Throwable e) {
closeAllSuppress(e, queryRunner, embeddedKafka);
throw e;
}
}
Aggregations