use of com.facebook.presto.testing.LocalQueryRunner 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.testing.LocalQueryRunner 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.testing.LocalQueryRunner 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.testing.LocalQueryRunner in project presto by prestodb.
the class TestLocalQueriesIndexed 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 IndexedTpchConnectorFactory(INDEX_SPEC, 1), ImmutableMap.of());
return localQueryRunner;
}
Aggregations