Search in sources :

Example 1 with ResetSession

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"));
}
Also used : QueryId(com.facebook.presto.spi.QueryId) ResetSession(com.facebook.presto.sql.tree.ResetSession) ResetSession(com.facebook.presto.sql.tree.ResetSession) Session(com.facebook.presto.Session) Test(org.testng.annotations.Test)

Example 2 with ResetSession

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")));
}
Also used : ResetSession(com.facebook.presto.sql.tree.ResetSession) Test(org.testng.annotations.Test)

Aggregations

ResetSession (com.facebook.presto.sql.tree.ResetSession)2 Test (org.testng.annotations.Test)2 Session (com.facebook.presto.Session)1 QueryId (com.facebook.presto.spi.QueryId)1