use of com.facebook.presto.sql.tree.ResetSession in project presto by prestodb.
the class TestResetSessionTask method test.
@Test
public void test() throws Exception {
Session session = testSessionBuilder(metadata.getSessionPropertyManager()).setSystemProperty("foo", "bar").setCatalogSessionProperty(CATALOG_NAME, "baz", "blah").build();
QueryStateMachine stateMachine = QueryStateMachine.begin(new QueryId("query"), "reset foo", session, URI.create("fake://uri"), false, transactionManager, accessControl, executor, metadata);
getFutureValue(new ResetSessionTask().execute(new ResetSession(QualifiedName.of(CATALOG_NAME, "baz")), transactionManager, metadata, accessControl, stateMachine, emptyList()));
Set<String> sessionProperties = stateMachine.getResetSessionProperties();
assertEquals(sessionProperties, ImmutableSet.of("catalog.baz"));
}
use of com.facebook.presto.sql.tree.ResetSession in project presto by prestodb.
the class TestSqlParser method testResetSession.
@Test
public void testResetSession() throws Exception {
assertStatement("RESET SESSION foo.bar", new ResetSession(QualifiedName.of("foo", "bar")));
assertStatement("RESET SESSION foo", new ResetSession(QualifiedName.of("foo")));
}
Aggregations