Java 类com.facebook.presto.sql.tree.ShowCatalogs 实例源码

项目:presto-query-formatter    文件:StatementFormatter.java   
@Override
protected Void visitShowCatalogs(ShowCatalogs node, Integer context)
{
    builder.append("SHOW CATALOGS");

    node.getLikePattern().ifPresent((value) ->
            builder.append(" LIKE ")
                    .append(formatStringLiteral(value)));

    return null;
}
项目:presto    文件:StatementAnalyzer.java   
@Override
protected RelationType visitShowCatalogs(ShowCatalogs node, AnalysisContext context)
{
    List<Expression> rows = metadata.getCatalogNames().keySet().stream()
            .map(name -> row(new StringLiteral(name)))
            .collect(toList());

    Query query = simpleQuery(
            selectList(new AllColumns()),
            aliased(new Values(rows), "catalogs", ImmutableList.of("Catalog")));

    return process(query, context);
}
项目:presto    文件:SqlFormatter.java   
@Override
protected Void visitShowCatalogs(ShowCatalogs node, Integer context)
{
    builder.append("SHOW CATALOGS");

    return null;
}
项目:EchoQuery    文件:SqlFormatter.java   
@Override
protected Void visitShowCatalogs(ShowCatalogs node, Integer context)
{
    builder.append("SHOW CATALOGS");

    return null;
}
项目:presto    文件:AstBuilder.java   
@Override
public Node visitShowCatalogs(SqlBaseParser.ShowCatalogsContext context)
{
    return new ShowCatalogs(getLocation(context));
}
项目:presto    文件:TestSqlParser.java   
@Test
public void testShowCatalogs()
        throws Exception
{
    assertStatement("SHOW CATALOGS", new ShowCatalogs());
}