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")));
}
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"));
}
Aggregations