Search in sources :

Example 26 with SessionPropertyManager

use of com.facebook.presto.metadata.SessionPropertyManager in project presto by prestodb.

the class TestQueryPlanDeterminism method createQueryRunner.

@Override
protected QueryRunner createQueryRunner() {
    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());
    localQueryRunner.getMetadata().registerBuiltInFunctions(CUSTOM_FUNCTIONS);
    SessionPropertyManager sessionPropertyManager = localQueryRunner.getMetadata().getSessionPropertyManager();
    sessionPropertyManager.addSystemSessionProperties(TEST_SYSTEM_PROPERTIES);
    sessionPropertyManager.addConnectorSessionProperties(new ConnectorId(TESTING_CATALOG), TEST_CATALOG_PROPERTIES);
    return localQueryRunner;
}
Also used : TpchConnectorFactory(com.facebook.presto.tpch.TpchConnectorFactory) SessionPropertyManager(com.facebook.presto.metadata.SessionPropertyManager) LocalQueryRunner(com.facebook.presto.testing.LocalQueryRunner) Session(com.facebook.presto.Session) ConnectorId(com.facebook.presto.spi.ConnectorId)

Aggregations

SessionPropertyManager (com.facebook.presto.metadata.SessionPropertyManager)26 Test (org.testng.annotations.Test)15 Session (com.facebook.presto.Session)11 ConnectorId (com.facebook.presto.spi.ConnectorId)9 InMemoryNodeManager (com.facebook.presto.metadata.InMemoryNodeManager)8 InternalNode (com.facebook.presto.metadata.InternalNode)8 QueryId (com.facebook.presto.spi.QueryId)8 AllowAllAccessControl (com.facebook.presto.security.AllowAllAccessControl)4 LocalQueryRunner (com.facebook.presto.testing.LocalQueryRunner)4 TpchConnectorFactory (com.facebook.presto.tpch.TpchConnectorFactory)4 NodeMemoryConfig (com.facebook.presto.memory.NodeMemoryConfig)3 HttpServletRequest (javax.servlet.http.HttpServletRequest)3 SystemSessionProperties (com.facebook.presto.SystemSessionProperties)2 ConnectorId (com.facebook.presto.connector.ConnectorId)2 QueryManagerConfig (com.facebook.presto.execution.QueryManagerConfig)2 TaskManagerConfig (com.facebook.presto.execution.TaskManagerConfig)2 NodeSchedulerConfig (com.facebook.presto.execution.scheduler.NodeSchedulerConfig)2 WarningCollectorConfig (com.facebook.presto.execution.warnings.WarningCollectorConfig)2 MemoryManagerConfig (com.facebook.presto.memory.MemoryManagerConfig)2 PrestoException (com.facebook.presto.spi.PrestoException)2