Search in sources :

Example 1 with ResetSession

use of io.prestosql.sql.tree.ResetSession in project hetu-core by openlookeng.

the class TestSqlParser method testResetSession.

@Test
public void testResetSession() {
    assertStatement("RESET SESSION foo.bar", new ResetSession(QualifiedName.of("foo", "bar")));
    assertStatement("RESET SESSION foo", new ResetSession(QualifiedName.of("foo")));
}
Also used : ResetSession(io.prestosql.sql.tree.ResetSession) Test(org.testng.annotations.Test)

Example 2 with ResetSession

use of io.prestosql.sql.tree.ResetSession in project hetu-core by openlookeng.

the class TestResetSessionTask method test.

@Test
public void test() {
    Session session = testSessionBuilder(metadata.getSessionPropertyManager()).setSystemProperty("foo", "bar").setCatalogSessionProperty(CATALOG_NAME, "baz", "blah").build();
    QueryStateMachine stateMachine = QueryStateMachine.begin("reset foo", Optional.empty(), session, URI.create("fake://uri"), new ResourceGroupId("test"), new NoOpResourceGroupManager(), false, transactionManager, accessControl, executor, metadata, WarningCollector.NOOP);
    getFutureValue(new ResetSessionTask().execute(new ResetSession(QualifiedName.of(CATALOG_NAME, "baz")), transactionManager, metadata, accessControl, stateMachine, emptyList(), new HeuristicIndexerManager(new FileSystemClientManager(), new HetuMetaStoreManager())));
    Set<String> sessionProperties = stateMachine.getResetSessionProperties();
    assertEquals(sessionProperties, ImmutableSet.of("catalog.baz"));
}
Also used : ResourceGroupId(io.prestosql.spi.resourcegroups.ResourceGroupId) ResetSession(io.prestosql.sql.tree.ResetSession) HeuristicIndexerManager(io.prestosql.heuristicindex.HeuristicIndexerManager) HetuMetaStoreManager(io.prestosql.metastore.HetuMetaStoreManager) NoOpResourceGroupManager(io.prestosql.execution.resourcegroups.NoOpResourceGroupManager) ResetSession(io.prestosql.sql.tree.ResetSession) Session(io.prestosql.Session) FileSystemClientManager(io.prestosql.filesystem.FileSystemClientManager) Test(org.testng.annotations.Test)

Aggregations

ResetSession (io.prestosql.sql.tree.ResetSession)2 Test (org.testng.annotations.Test)2 Session (io.prestosql.Session)1 NoOpResourceGroupManager (io.prestosql.execution.resourcegroups.NoOpResourceGroupManager)1 FileSystemClientManager (io.prestosql.filesystem.FileSystemClientManager)1 HeuristicIndexerManager (io.prestosql.heuristicindex.HeuristicIndexerManager)1 HetuMetaStoreManager (io.prestosql.metastore.HetuMetaStoreManager)1 ResourceGroupId (io.prestosql.spi.resourcegroups.ResourceGroupId)1