Search in sources :

Example 6 with SessionBuilder

use of com.facebook.presto.Session.SessionBuilder 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;
}
Also used : TpchConnectorFactory(com.facebook.presto.tpch.TpchConnectorFactory) SessionBuilder(com.facebook.presto.Session.SessionBuilder) TestingSession.testSessionBuilder(com.facebook.presto.testing.TestingSession.testSessionBuilder) LocalQueryRunner(com.facebook.presto.testing.LocalQueryRunner) Session(com.facebook.presto.Session)

Aggregations

SessionBuilder (com.facebook.presto.Session.SessionBuilder)6 Session (com.facebook.presto.Session)4 TestingSession.testSessionBuilder (com.facebook.presto.testing.TestingSession.testSessionBuilder)4 LocalQueryRunner (com.facebook.presto.testing.LocalQueryRunner)2 TpchConnectorFactory (com.facebook.presto.tpch.TpchConnectorFactory)2 Map (java.util.Map)2 EventsBuilder (com.facebook.presto.execution.TestEventListener.EventsBuilder)1 TestingEventListenerPlugin (com.facebook.presto.execution.TestEventListenerPlugin.TestingEventListenerPlugin)1 WarningCode (com.facebook.presto.spi.WarningCode)1 SqlFunctionId (com.facebook.presto.spi.function.SqlFunctionId)1 SqlInvokedFunction (com.facebook.presto.spi.function.SqlInvokedFunction)1 AccessControlContext (com.facebook.presto.spi.security.AccessControlContext)1 Identity (com.facebook.presto.spi.security.Identity)1 ImmutableCollectors.toImmutableMap (com.facebook.presto.util.ImmutableCollectors.toImmutableMap)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 HashMap (java.util.HashMap)1 BeforeClass (org.testng.annotations.BeforeClass)1