Package com.facebook.presto.sql.tree

Examples of com.facebook.presto.sql.tree.Row


    {
        assertStatement("VALUES ('a', 1, 2.2), ('b', 2, 3.3)",
                new Query(
                        Optional.<With>absent(),
                        new Values(ImmutableList.of(
                                new Row(ImmutableList.<Expression>of(
                                        new StringLiteral("a"),
                                        new LongLiteral("1"),
                                        new DoubleLiteral("2.2")
                                )),
                                new Row(ImmutableList.<Expression>of(
                                        new StringLiteral("b"),
                                        new LongLiteral("2"),
                                        new DoubleLiteral("3.3")
                                ))
                        )),
                        ImmutableList.<SortItem>of(),
                        Optional.<String>absent(),
                        Optional.<Approximate>absent()));

        assertStatement("SELECT * FROM (VALUES ('a', 1, 2.2), ('b', 2, 3.3))",
                new Query(
                        Optional.<With>absent(),
                        new QuerySpecification(
                                selectList(new AllColumns()),
                                ImmutableList.<Relation>of(new TableSubquery(
                                        new Query(
                                                Optional.<With>absent(),
                                                new Values(ImmutableList.of(
                                                        new Row(ImmutableList.<Expression>of(
                                                                new StringLiteral("a"),
                                                                new LongLiteral("1"),
                                                                new DoubleLiteral("2.2")
                                                        )),
                                                        new Row(ImmutableList.<Expression>of(
                                                                new StringLiteral("b"),
                                                                new LongLiteral("2"),
                                                                new DoubleLiteral("3.3")
                                                        ))
                                                )),
View Full Code Here


    {
        assertStatement("VALUES ('a', 1, 2.2), ('b', 2, 3.3)",
                new Query(
                        Optional.<With>absent(),
                        new Values(ImmutableList.of(
                                new Row(ImmutableList.<Expression>of(
                                        new StringLiteral("a"),
                                        new LongLiteral("1"),
                                        new DoubleLiteral("2.2")
                                )),
                                new Row(ImmutableList.<Expression>of(
                                        new StringLiteral("b"),
                                        new LongLiteral("2"),
                                        new DoubleLiteral("3.3")
                                ))
                        )),
                        ImmutableList.<SortItem>of(),
                        Optional.<String>absent(),
                        Optional.<Approximate>absent()));

        assertStatement("SELECT * FROM (VALUES ('a', 1, 2.2), ('b', 2, 3.3))",
                new Query(
                        Optional.<With>absent(),
                        new QuerySpecification(
                                selectList(new AllColumns()),
                                ImmutableList.<Relation>of(new TableSubquery(
                                        new Query(
                                                Optional.<With>absent(),
                                                new Values(ImmutableList.of(
                                                        new Row(ImmutableList.<Expression>of(
                                                                new StringLiteral("a"),
                                                                new LongLiteral("1"),
                                                                new DoubleLiteral("2.2")
                                                        )),
                                                        new Row(ImmutableList.<Expression>of(
                                                                new StringLiteral("b"),
                                                                new LongLiteral("2"),
                                                                new DoubleLiteral("3.3")
                                                        ))
                                                )),
View Full Code Here

        return new Values(ImmutableList.copyOf(row));
    }

    public static Row row(Expression... values)
    {
        return new Row(ImmutableList.copyOf(values));
    }
View Full Code Here

    {
        assertStatement("VALUES ('a', 1, 2.2), ('b', 2, 3.3)",
                new Query(
                        Optional.<With>absent(),
                        new Values(ImmutableList.of(
                                new Row(ImmutableList.<Expression>of(
                                        new StringLiteral("a"),
                                        new LongLiteral("1"),
                                        new DoubleLiteral("2.2")
                                )),
                                new Row(ImmutableList.<Expression>of(
                                        new StringLiteral("b"),
                                        new LongLiteral("2"),
                                        new DoubleLiteral("3.3")
                                ))
                        )),
                        ImmutableList.<SortItem>of(),
                        Optional.<String>absent(),
                        Optional.<Approximate>absent()));

        assertStatement("SELECT * FROM (VALUES ('a', 1, 2.2), ('b', 2, 3.3))",
                new Query(
                        Optional.<With>absent(),
                        new QuerySpecification(
                                selectList(new AllColumns()),
                                ImmutableList.<Relation>of(new TableSubquery(
                                        new Query(
                                                Optional.<With>absent(),
                                                new Values(ImmutableList.of(
                                                        new Row(ImmutableList.<Expression>of(
                                                                new StringLiteral("a"),
                                                                new LongLiteral("1"),
                                                                new DoubleLiteral("2.2")
                                                        )),
                                                        new Row(ImmutableList.<Expression>of(
                                                                new StringLiteral("b"),
                                                                new LongLiteral("2"),
                                                                new DoubleLiteral("3.3")
                                                        ))
                                                )),
View Full Code Here

    {
        assertStatement("VALUES ('a', 1, 2.2), ('b', 2, 3.3)",
                new Query(
                        Optional.<With>absent(),
                        new Values(ImmutableList.of(
                                new Row(ImmutableList.<Expression>of(
                                        new StringLiteral("a"),
                                        new LongLiteral("1"),
                                        new DoubleLiteral("2.2")
                                )),
                                new Row(ImmutableList.<Expression>of(
                                        new StringLiteral("b"),
                                        new LongLiteral("2"),
                                        new DoubleLiteral("3.3")
                                ))
                        )),
                        ImmutableList.<SortItem>of(),
                        Optional.<String>absent(),
                        Optional.<Approximate>absent()));

        assertStatement("SELECT * FROM (VALUES ('a', 1, 2.2), ('b', 2, 3.3))",
                new Query(
                        Optional.<With>absent(),
                        new QuerySpecification(
                                selectList(new AllColumns()),
                                ImmutableList.<Relation>of(new TableSubquery(
                                        new Query(
                                                Optional.<With>absent(),
                                                new Values(ImmutableList.of(
                                                        new Row(ImmutableList.<Expression>of(
                                                                new StringLiteral("a"),
                                                                new LongLiteral("1"),
                                                                new DoubleLiteral("2.2")
                                                        )),
                                                        new Row(ImmutableList.<Expression>of(
                                                                new StringLiteral("b"),
                                                                new LongLiteral("2"),
                                                                new DoubleLiteral("3.3")
                                                        ))
                                                )),
View Full Code Here

    {
        assertStatement("VALUES ('a', 1, 2.2), ('b', 2, 3.3)",
                new Query(
                        Optional.<With>absent(),
                        new Values(ImmutableList.of(
                                new Row(ImmutableList.<Expression>of(
                                        new StringLiteral("a"),
                                        new LongLiteral("1"),
                                        new DoubleLiteral("2.2")
                                )),
                                new Row(ImmutableList.<Expression>of(
                                        new StringLiteral("b"),
                                        new LongLiteral("2"),
                                        new DoubleLiteral("3.3")
                                ))
                        )),
                        ImmutableList.<SortItem>of(),
                        Optional.<String>absent(),
                        Optional.<Approximate>absent()));

        assertStatement("SELECT * FROM (VALUES ('a', 1, 2.2), ('b', 2, 3.3))",
                new Query(
                        Optional.<With>absent(),
                        new QuerySpecification(
                                selectList(new AllColumns()),
                                ImmutableList.<Relation>of(new TableSubquery(
                                        new Query(
                                                Optional.<With>absent(),
                                                new Values(ImmutableList.of(
                                                        new Row(ImmutableList.<Expression>of(
                                                                new StringLiteral("a"),
                                                                new LongLiteral("1"),
                                                                new DoubleLiteral("2.2")
                                                        )),
                                                        new Row(ImmutableList.<Expression>of(
                                                                new StringLiteral("b"),
                                                                new LongLiteral("2"),
                                                                new DoubleLiteral("3.3")
                                                        ))
                                                )),
View Full Code Here

    {
        assertStatement("VALUES ('a', 1, 2.2), ('b', 2, 3.3)",
                new Query(
                        Optional.<With>absent(),
                        new Values(ImmutableList.of(
                                new Row(ImmutableList.<Expression>of(
                                        new StringLiteral("a"),
                                        new LongLiteral("1"),
                                        new DoubleLiteral("2.2")
                                )),
                                new Row(ImmutableList.<Expression>of(
                                        new StringLiteral("b"),
                                        new LongLiteral("2"),
                                        new DoubleLiteral("3.3")
                                ))
                        )),
                        ImmutableList.<SortItem>of(),
                        Optional.<String>absent(),
                        Optional.<Approximate>absent()));

        assertStatement("SELECT * FROM (VALUES ('a', 1, 2.2), ('b', 2, 3.3))",
                new Query(
                        Optional.<With>absent(),
                        new QuerySpecification(
                                selectList(new AllColumns()),
                                ImmutableList.<Relation>of(new TableSubquery(
                                        new Query(
                                                Optional.<With>absent(),
                                                new Values(ImmutableList.of(
                                                        new Row(ImmutableList.<Expression>of(
                                                                new StringLiteral("a"),
                                                                new LongLiteral("1"),
                                                                new DoubleLiteral("2.2")
                                                        )),
                                                        new Row(ImmutableList.<Expression>of(
                                                                new StringLiteral("b"),
                                                                new LongLiteral("2"),
                                                                new DoubleLiteral("3.3")
                                                        ))
                                                )),
View Full Code Here

    {
        assertStatement("VALUES ('a', 1, 2.2), ('b', 2, 3.3)",
                new Query(
                        Optional.<With>absent(),
                        new Values(ImmutableList.of(
                                new Row(ImmutableList.<Expression>of(
                                        new StringLiteral("a"),
                                        new LongLiteral("1"),
                                        new DoubleLiteral("2.2")
                                )),
                                new Row(ImmutableList.<Expression>of(
                                        new StringLiteral("b"),
                                        new LongLiteral("2"),
                                        new DoubleLiteral("3.3")
                                ))
                        )),
                        ImmutableList.<SortItem>of(),
                        Optional.<String>absent(),
                        Optional.<Approximate>absent()));

        assertStatement("SELECT * FROM (VALUES ('a', 1, 2.2), ('b', 2, 3.3))",
                new Query(
                        Optional.<With>absent(),
                        new QuerySpecification(
                                selectList(new AllColumns()),
                                ImmutableList.<Relation>of(new TableSubquery(
                                        new Query(
                                                Optional.<With>absent(),
                                                new Values(ImmutableList.of(
                                                        new Row(ImmutableList.<Expression>of(
                                                                new StringLiteral("a"),
                                                                new LongLiteral("1"),
                                                                new DoubleLiteral("2.2")
                                                        )),
                                                        new Row(ImmutableList.<Expression>of(
                                                                new StringLiteral("b"),
                                                                new LongLiteral("2"),
                                                                new DoubleLiteral("3.3")
                                                        ))
                                                )),
View Full Code Here

    {
        assertStatement("VALUES ('a', 1, 2.2), ('b', 2, 3.3)",
                new Query(
                        Optional.<With>absent(),
                        new Values(ImmutableList.of(
                                new Row(ImmutableList.<Expression>of(
                                        new StringLiteral("a"),
                                        new LongLiteral("1"),
                                        new DoubleLiteral("2.2")
                                )),
                                new Row(ImmutableList.<Expression>of(
                                        new StringLiteral("b"),
                                        new LongLiteral("2"),
                                        new DoubleLiteral("3.3")
                                ))
                        )),
                        ImmutableList.<SortItem>of(),
                        Optional.<String>absent(),
                        Optional.<Approximate>absent()));

        assertStatement("SELECT * FROM (VALUES ('a', 1, 2.2), ('b', 2, 3.3))",
                new Query(
                        Optional.<With>absent(),
                        new QuerySpecification(
                                selectList(new AllColumns()),
                                ImmutableList.<Relation>of(new TableSubquery(
                                        new Query(
                                                Optional.<With>absent(),
                                                new Values(ImmutableList.of(
                                                        new Row(ImmutableList.<Expression>of(
                                                                new StringLiteral("a"),
                                                                new LongLiteral("1"),
                                                                new DoubleLiteral("2.2")
                                                        )),
                                                        new Row(ImmutableList.<Expression>of(
                                                                new StringLiteral("b"),
                                                                new LongLiteral("2"),
                                                                new DoubleLiteral("3.3")
                                                        ))
                                                )),
View Full Code Here

TOP

Related Classes of com.facebook.presto.sql.tree.Row

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.