use of com.facebook.presto.Session 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.Session in project presto by prestodb.
the class RaptorBenchmarkQueryRunner method createLocalQueryRunner.
public static LocalQueryRunner createLocalQueryRunner() {
Session session = testSessionBuilder().setCatalog("raptor").setSchema("benchmark").build();
LocalQueryRunner localQueryRunner = new LocalQueryRunner(session);
// add tpch
localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
// add raptor
ConnectorFactory raptorConnectorFactory = getOnlyElement(new RaptorPlugin().getConnectorFactories());
Map<String, String> config = createRaptorConfig(TPCH_CACHE_DIR);
localQueryRunner.createCatalog("raptor", raptorConnectorFactory, config);
if (!localQueryRunner.tableExists(session, "orders")) {
localQueryRunner.execute("CREATE TABLE orders AS SELECT * FROM tpch.sf1.orders");
}
if (!localQueryRunner.tableExists(session, "lineitem")) {
localQueryRunner.execute("CREATE TABLE lineitem AS SELECT * FROM tpch.sf1.lineitem");
}
return localQueryRunner;
}
use of com.facebook.presto.Session in project presto by prestodb.
the class TestQueryPlanDeterminism method createLocalQueryRunner.
public 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.<String, String>of());
localQueryRunner.getMetadata().addFunctions(CUSTOM_FUNCTIONS);
SessionPropertyManager sessionPropertyManager = localQueryRunner.getMetadata().getSessionPropertyManager();
sessionPropertyManager.addSystemSessionProperties(TEST_SYSTEM_PROPERTIES);
sessionPropertyManager.addConnectorSessionProperties(new ConnectorId(TESTING_CATALOG), TEST_CATALOG_PROPERTIES);
return localQueryRunner;
}
use of com.facebook.presto.Session in project presto by prestodb.
the class TestQueryPlansDeterministic 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());
return localQueryRunner;
}
use of com.facebook.presto.Session in project presto by prestodb.
the class TpchQueryRunner method createQueryRunner.
public static DistributedQueryRunner createQueryRunner(Map<String, String> extraProperties, Map<String, String> coordinatorProperties) throws Exception {
Session session = testSessionBuilder().setSource("test").setCatalog("tpch").setSchema("tiny").build();
DistributedQueryRunner queryRunner = new DistributedQueryRunner(session, 4, extraProperties, coordinatorProperties, new SqlParserOptions());
try {
queryRunner.installPlugin(new TpchPlugin());
queryRunner.createCatalog("tpch", "tpch");
return queryRunner;
} catch (Exception e) {
queryRunner.close();
throw e;
}
}
Aggregations