use of com.facebook.presto.tpch.TpchConnectorFactory in project presto by prestodb.
the class TestMLQueries method createLocalQueryRunner.
private static LocalQueryRunner createLocalQueryRunner() {
Session defaultSession = testSessionBuilder().setCatalog("local").setSchema(TINY_SCHEMA_NAME).build();
LocalQueryRunner localQueryRunner = new LocalQueryRunner(defaultSession);
// add the tpch catalog
// local queries run directly against the generator
localQueryRunner.createCatalog(defaultSession.getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of());
MLPlugin plugin = new MLPlugin();
for (Type type : plugin.getTypes()) {
localQueryRunner.getTypeManager().addType(type);
}
for (ParametricType parametricType : plugin.getParametricTypes()) {
localQueryRunner.getTypeManager().addParametricType(parametricType);
}
localQueryRunner.getMetadata().addFunctions(extractFunctions(new MLPlugin().getFunctions()));
return localQueryRunner;
}
use of com.facebook.presto.tpch.TpchConnectorFactory in project presto by prestodb.
the class MemoryLocalQueryRunner method createMemoryLocalQueryRunner.
private static LocalQueryRunner createMemoryLocalQueryRunner() {
Session.SessionBuilder sessionBuilder = testSessionBuilder().setCatalog("memory").setSchema("default");
Session session = sessionBuilder.build();
LocalQueryRunner localQueryRunner = LocalQueryRunner.queryRunnerWithInitialTransaction(session);
// add tpch
localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.<String, String>of());
localQueryRunner.createCatalog("memory", new MemoryConnectorFactory(), ImmutableMap.<String, String>of());
return localQueryRunner;
}
use of com.facebook.presto.tpch.TpchConnectorFactory in project presto by prestodb.
the class BenchmarkQueryRunner method createLocalQueryRunner.
public static LocalQueryRunner createLocalQueryRunner(boolean hashingEnabled) {
SessionBuilder sessionBuilder = testSessionBuilder().setCatalog("tpch").setSchema(TINY_SCHEMA_NAME);
if (hashingEnabled) {
sessionBuilder.setSystemProperty("optimizer.optimize_hash_generation", "true");
}
Session session = sessionBuilder.build();
LocalQueryRunner localQueryRunner = new LocalQueryRunner(session);
// add tpch
localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
return localQueryRunner;
}
use of com.facebook.presto.tpch.TpchConnectorFactory in project presto by prestodb.
the class BenchmarkQueryRunner method createLocalQueryRunner.
public static LocalQueryRunner createLocalQueryRunner(Map<String, String> extraSessionProperties) {
SessionBuilder sessionBuilder = testSessionBuilder().setCatalog("tpch").setSchema(TINY_SCHEMA_NAME);
extraSessionProperties.forEach(sessionBuilder::setSystemProperty);
Session session = sessionBuilder.build();
LocalQueryRunner localQueryRunner = new LocalQueryRunner(session);
// add tpch
localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
return localQueryRunner;
}
use of com.facebook.presto.tpch.TpchConnectorFactory in project presto by prestodb.
the class MemoryLocalQueryRunner method createMemoryLocalQueryRunner.
private static LocalQueryRunner createMemoryLocalQueryRunner(Session session) {
LocalQueryRunner localQueryRunner = LocalQueryRunner.queryRunnerWithInitialTransaction(session);
// add tpch
localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
localQueryRunner.createCatalog("memory", new MemoryConnectorFactory(), ImmutableMap.of("memory.max-data-per-node", "4GB"));
return localQueryRunner;
}
Aggregations