use of com.facebook.presto.tpch.TpchPlugin in project presto by prestodb.
the class TestBeginQuery method setUp.
@BeforeClass
public void setUp() throws Exception {
metadata = new TestMetadata();
getQueryRunner().installPlugin(new TestPlugin(metadata));
getQueryRunner().installPlugin(new TpchPlugin());
getQueryRunner().createCatalog("test", "test", ImmutableMap.of());
getQueryRunner().createCatalog("tpch", "tpch", ImmutableMap.of());
}
use of com.facebook.presto.tpch.TpchPlugin in project presto by prestodb.
the class TestEventListener method setUp.
@BeforeClass
private void setUp() throws Exception {
session = testSessionBuilder().setSystemProperty("task_concurrency", "1").setCatalog("tpch").setSchema("tiny").setClientInfo("{\"clientVersion\":\"testVersion\"}").build();
queryRunner = new DistributedQueryRunner(session, 1);
queryRunner.installPlugin(new TpchPlugin());
queryRunner.installPlugin(new TestingEventListenerPlugin(generatedEvents));
queryRunner.createCatalog("tpch", "tpch", ImmutableMap.of("tpch.splits-per-node", Integer.toString(SPLITS_PER_NODE)));
}
use of com.facebook.presto.tpch.TpchPlugin in project presto by prestodb.
the class TestQueues method createQueryRunner.
private static DistributedQueryRunner createQueryRunner(Map<String, String> properties) throws Exception {
DistributedQueryRunner queryRunner = new DistributedQueryRunner(testSessionBuilder().build(), 2, ImmutableMap.of(), properties, new SqlParserOptions());
try {
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
return queryRunner;
} catch (Exception e) {
queryRunner.close();
throw e;
}
}
use of com.facebook.presto.tpch.TpchPlugin in project presto by prestodb.
the class TestQueues method createQueryRunner.
private static DistributedQueryRunner createQueryRunner(String dbConfigUrl, H2ResourceGroupsDao dao) throws Exception {
ImmutableMap.Builder<String, String> builder = ImmutableMap.builder();
builder.put("experimental.resource-groups-enabled", "true");
Map<String, String> properties = builder.build();
DistributedQueryRunner queryRunner = new DistributedQueryRunner(testSessionBuilder().build(), 2, ImmutableMap.of(), properties, new SqlParserOptions());
try {
Plugin h2ResourceGroupManagerPlugin = new H2ResourceGroupManagerPlugin();
queryRunner.installPlugin(h2ResourceGroupManagerPlugin);
queryRunner.getCoordinator().getResourceGroupManager().get().setConfigurationManager(NAME, ImmutableMap.of("resource-groups.config-db-url", dbConfigUrl));
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
setup(queryRunner, dao);
return queryRunner;
} catch (Exception e) {
queryRunner.close();
throw e;
}
}
use of com.facebook.presto.tpch.TpchPlugin in project presto by prestodb.
the class RedisQueryRunner method createRedisQueryRunner.
public static DistributedQueryRunner createRedisQueryRunner(EmbeddedRedis embeddedRedis, String dataFormat, Iterable<TpchTable<?>> tables) throws Exception {
DistributedQueryRunner queryRunner = null;
try {
queryRunner = new DistributedQueryRunner(createSession(), 2);
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
embeddedRedis.start();
Map<SchemaTableName, RedisTableDescription> tableDescriptions = createTpchTableDescriptions(queryRunner.getCoordinator().getMetadata(), tables, dataFormat);
installRedisPlugin(embeddedRedis, queryRunner, tableDescriptions);
TestingPrestoClient prestoClient = queryRunner.getClient();
log.info("Loading data...");
long startTime = System.nanoTime();
for (TpchTable<?> table : tables) {
loadTpchTable(embeddedRedis, prestoClient, table, dataFormat);
}
log.info("Loading complete in %s", nanosSince(startTime).toString(SECONDS));
embeddedRedis.destroyJedisPool();
return queryRunner;
} catch (Throwable e) {
closeAllSuppress(e, queryRunner, embeddedRedis);
throw e;
}
}
Aggregations