@Override
protected Void visitShowSession(ShowSession node, Integer context)
{
builder.append("SHOW SESSION");
return null;
}
java类com.facebook.presto.sql.tree.ShowSession的实例源码
StatementFormatter.java 文件源码
项目:presto-query-formatter
阅读 32
收藏 0
点赞 0
评论 0
StatementAnalyzer.java 文件源码
项目:presto
阅读 25
收藏 0
点赞 0
评论 0
@Override
protected RelationType visitShowSession(ShowSession node, AnalysisContext context)
{
ImmutableList.Builder<Expression> rows = ImmutableList.builder();
List<SessionPropertyValue> sessionProperties = metadata.getSessionPropertyManager().getAllSessionProperties(session);
for (SessionPropertyValue sessionProperty : sessionProperties) {
if (sessionProperty.isHidden()) {
continue;
}
String value = sessionProperty.getValue();
String defaultValue = sessionProperty.getDefaultValue();
rows.add(row(
new StringLiteral(sessionProperty.getFullyQualifiedName()),
new StringLiteral(nullToEmpty(value)),
new StringLiteral(nullToEmpty(defaultValue)),
new StringLiteral(sessionProperty.getType()),
new StringLiteral(sessionProperty.getDescription()),
TRUE_LITERAL));
}
// add bogus row so we can support empty sessions
StringLiteral empty = new StringLiteral("");
rows.add(row(empty, empty, empty, empty, empty, FALSE_LITERAL));
Query query = simpleQuery(
selectList(
aliasedName("name", "Name"),
aliasedName("value", "Value"),
aliasedName("default", "Default"),
aliasedName("type", "Type"),
aliasedName("description", "Description")),
aliased(
new Values(rows.build()),
"session",
ImmutableList.of("name", "value", "default", "type", "description", "include")),
nameReference("include"));
return process(query, context);
}
SqlFormatter.java 文件源码
项目:presto
阅读 23
收藏 0
点赞 0
评论 0
@Override
protected Void visitShowSession(ShowSession node, Integer context)
{
builder.append("SHOW SESSION");
return null;
}
SqlFormatter.java 文件源码
项目:EchoQuery
阅读 23
收藏 0
点赞 0
评论 0
@Override
protected Void visitShowSession(ShowSession node, Integer context)
{
builder.append("SHOW SESSION");
return null;
}
AstBuilder.java 文件源码
项目:presto
阅读 21
收藏 0
点赞 0
评论 0
@Override
public Node visitShowSession(SqlBaseParser.ShowSessionContext context)
{
return new ShowSession(getLocation(context));
}
TestSqlParser.java 文件源码
项目:presto
阅读 22
收藏 0
点赞 0
评论 0
@Test
public void testShowSession()
throws Exception
{
assertStatement("SHOW SESSION", new ShowSession());
}