本文整理汇总了Java中com.facebook.presto.sql.tree.ShowSchemas类的典型用法代码示例。如果您正苦于以下问题:Java ShowSchemas类的具体用法?Java ShowSchemas怎么用?Java ShowSchemas使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ShowSchemas类属于com.facebook.presto.sql.tree包,在下文中一共展示了ShowSchemas类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitShowSchemas
import com.facebook.presto.sql.tree.ShowSchemas; //导入依赖的package包/类
@Override
protected Void visitShowSchemas(ShowSchemas node, Integer context)
{
builder.append("SHOW SCHEMAS");
if (node.getCatalog().isPresent()) {
builder.append(" FROM ")
.append(node.getCatalog().get());
}
node.getLikePattern().ifPresent((value) ->
builder.append(" LIKE ")
.append(formatStringLiteral(value)));
return null;
}
示例2: visitShowSchemas
import com.facebook.presto.sql.tree.ShowSchemas; //导入依赖的package包/类
@Override
protected RelationType visitShowSchemas(ShowSchemas node, AnalysisContext context)
{
if (!node.getCatalog().isPresent() && !session.getCatalog().isPresent()) {
throw new SemanticException(CATALOG_NOT_SPECIFIED, node, "Catalog must be specified when session catalog is not set");
}
Query query = simpleQuery(
selectList(aliasedName("schema_name", "Schema")),
from(node.getCatalog().orElseGet(() -> session.getCatalog().get()), TABLE_SCHEMATA),
ordering(ascending("schema_name")));
return process(query, context);
}
示例3: visitShowSchemas
import com.facebook.presto.sql.tree.ShowSchemas; //导入依赖的package包/类
@Override
protected Void visitShowSchemas(ShowSchemas node, Integer context)
{
builder.append("SHOW SCHEMAS");
if (node.getCatalog().isPresent()) {
builder.append(" FROM ")
.append(node.getCatalog().get());
}
return null;
}
示例4: testShowSchemas
import com.facebook.presto.sql.tree.ShowSchemas; //导入依赖的package包/类
@Test
public void testShowSchemas()
throws Exception
{
assertStatement("SHOW SCHEMAS", new ShowSchemas(Optional.<String>empty()));
assertStatement("SHOW SCHEMAS FROM foo", new ShowSchemas(Optional.of("foo")));
assertStatement("SHOW SCHEMAS IN foo", new ShowSchemas(Optional.of("foo")));
}
示例5: visitShowSchemas
import com.facebook.presto.sql.tree.ShowSchemas; //导入依赖的package包/类
@Override
public Node visitShowSchemas(SqlBaseParser.ShowSchemasContext context)
{
return new ShowSchemas(getLocation(context), getTextIfPresent(context.identifier()));
}