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

项目:hue    文件:VeroSalesforceSqlFormatter.java   
@Override
protected Void visitSelect(Select node, Integer indent)
{
    super.visitSelect(node,  indent);

    if (_createTempTable == true) {
        builder.append("INTO ").append(getIdenSurroundingSymbolLeft())
        .append(caseSensitivityName(_tempTableName)).append(getIdenSurroundingSymbolRight())
        .append("\n");
    }

    return null;
}
项目:hue    文件:VeroMssqlSqlFormatter.java   
@Override
protected Void visitSelect(Select node, Integer indent)
{
    super.visitSelect(node,  indent);

    if (_createTempTable == true) {
        builder.append("INTO ").append(getIdenSurroundingSymbolLeft())
        .append(caseSensitivityName(_tempTableName)).append(getIdenSurroundingSymbolRight())
        .append("\n");
    }

    return null;
}
项目:hue    文件:VeroGoogleAnalyticsSqlFormatter.java   
@Override
protected Void visitSelect(Select node, Integer indent)
{
    super.visitSelect(node,  indent);

    if (_createTempTable == true) {
        builder.append("INTO ").append(getIdenSurroundingSymbolLeft())
        .append(caseSensitivityName(_tempTableName)).append(getIdenSurroundingSymbolRight())
        .append("\n");
    }

    return null;
}
项目:presto-query-formatter    文件:StatementFormatter.java   
@Override
protected Void visitSelect(Select node, Integer indent)
{
    append(indent, "SELECT");
    if (node.isDistinct()) {
        builder.append(" DISTINCT");
    }

    if (node.getSelectItems().size() > 1) {
        boolean first = true;
        for (SelectItem item : node.getSelectItems()) {
            builder.append("\n")
                    .append(indentString(indent))
                    .append(first ? "  " : ", ");

            process(item, indent);
            first = false;
        }
    }
    else {
        builder.append(' ');
        process(getOnlyElement(node.getSelectItems()), indent);
    }

    builder.append('\n');

    return null;
}
项目:presto    文件:SqlFormatter.java   
@Override
protected Void visitSelect(Select node, Integer indent)
{
    append(indent, "SELECT");
    if (node.isDistinct()) {
        builder.append(" DISTINCT");
    }

    if (node.getSelectItems().size() > 1) {
        boolean first = true;
        for (SelectItem item : node.getSelectItems()) {
            builder.append("\n")
                    .append(indentString(indent))
                    .append(first ? "  " : ", ");

            process(item, indent);
            first = false;
        }
    }
    else {
        builder.append(' ');
        process(getOnlyElement(node.getSelectItems()), indent);
    }

    builder.append('\n');

    return null;
}
项目:presto    文件:QueryUtil.java   
public static Select selectList(Expression... expressions)
{
    ImmutableList.Builder<SelectItem> items = ImmutableList.builder();
    for (Expression expression : expressions) {
        items.add(new SingleColumn(expression));
    }
    return new Select(false, items.build());
}
项目:presto    文件:QueryUtil.java   
public static Query simpleQuery(Select select, Relation from, Optional<Expression> where, List<GroupingElement> groupBy, Optional<Expression> having, List<SortItem> ordering, Optional<String> limit)
{
    return query(new QuerySpecification(
            select,
            Optional.of(from),
            where,
            groupBy,
            having,
            ordering,
            limit));
}
项目:EchoQuery    文件:SqlFormatter.java   
@Override
protected Void visitSelect(Select node, Integer indent)
{
    append(indent, "SELECT");
    if (node.isDistinct()) {
        builder.append(" DISTINCT");
    }

    if (node.getSelectItems().size() > 1) {
        boolean first = true;
        for (SelectItem item : node.getSelectItems()) {
            builder.append("\n")
                    .append(indentString(indent))
                    .append(first ? "  " : ", ");

            process(item, indent);
            first = false;
        }
    }
    else {
        builder.append(' ');
        process(getOnlyElement(node.getSelectItems()), indent);
    }

    builder.append('\n');

    return null;
}
项目:presto    文件:QueryUtil.java   
public static Select selectList(SelectItem... items)
{
    return new Select(false, ImmutableList.copyOf(items));
}
项目:presto    文件:QueryUtil.java   
public static Select selectAll(List<SelectItem> items)
{
    return new Select(false, items);
}
项目:presto    文件:QueryUtil.java   
public static Query simpleQuery(Select select, Relation from)
{
    return simpleQuery(select, from, Optional.empty(), ImmutableList.of());
}
项目:presto    文件:QueryUtil.java   
public static Query simpleQuery(Select select, Relation from, List<SortItem> ordering)
{
    return simpleQuery(select, from, Optional.empty(), ordering);
}
项目:presto    文件:QueryUtil.java   
public static Query simpleQuery(Select select, Relation from, Expression where)
{
    return simpleQuery(select, from, Optional.of(where), ImmutableList.of());
}
项目:presto    文件:QueryUtil.java   
public static Query simpleQuery(Select select, Relation from, Expression where, List<SortItem> ordering)
{
    return simpleQuery(select, from, Optional.of(where), ordering);
}
项目:presto    文件:QueryUtil.java   
public static Query simpleQuery(Select select, Relation from, Optional<Expression> where, List<SortItem> ordering)
{
    return simpleQuery(select, from, where, ImmutableList.of(), Optional.empty(), ordering, Optional.empty());
}