本文整理汇总了Java中com.facebook.presto.sql.tree.ResetSession类的典型用法代码示例。如果您正苦于以下问题:Java ResetSession类的具体用法?Java ResetSession怎么用?Java ResetSession使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ResetSession类属于com.facebook.presto.sql.tree包,在下文中一共展示了ResetSession类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitResetSession
import com.facebook.presto.sql.tree.ResetSession; //导入依赖的package包/类
@Override
public Void visitResetSession(ResetSession node, Integer context)
{
builder.append("RESET SESSION ")
.append(node.getName());
return null;
}
示例2: execute
import com.facebook.presto.sql.tree.ResetSession; //导入依赖的package包/类
@Override
public CompletableFuture<?> execute(ResetSession statement, TransactionManager transactionManager, Metadata metadata, AccessControl accessControl, QueryStateMachine stateMachine)
{
if (statement.getName().getParts().size() > 2) {
throw new SemanticException(INVALID_SESSION_PROPERTY, statement, "Invalid session property '%s'", statement.getName());
}
// validate the property name
metadata.getSessionPropertyManager().getSessionPropertyMetadata(statement.getName().toString());
stateMachine.addResetSessionProperties(statement.getName().toString());
return completedFuture(null);
}
示例3: test
import com.facebook.presto.sql.tree.ResetSession; //导入依赖的package包/类
@Test
public void test()
throws Exception
{
Session session = TEST_SESSION.withSystemProperty("foo", "bar").withCatalogProperty("catalog", "baz", "blah");
TransactionManager transactionManager = createTestTransactionManager();
QueryStateMachine stateMachine = QueryStateMachine.begin(new QueryId("query"), "reset foo", session, URI.create("fake://uri"), false, transactionManager, executor);
new ResetSessionTask().execute(new ResetSession(QualifiedName.of("catalog", "baz")), transactionManager, metadata, new AllowAllAccessControl(), stateMachine).join();
Set<String> sessionProperties = stateMachine.getResetSessionProperties();
assertEquals(sessionProperties, ImmutableSet.of("catalog.baz"));
}
示例4: testResetSession
import com.facebook.presto.sql.tree.ResetSession; //导入依赖的package包/类
@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")));
}
示例5: visitResetSession
import com.facebook.presto.sql.tree.ResetSession; //导入依赖的package包/类
@Override
public Node visitResetSession(SqlBaseParser.ResetSessionContext context)
{
return new ResetSession(getLocation(context), getQualifiedName(context.qualifiedName()));
}