Examples of AliasedRelation


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

        return new Row(ImmutableList.copyOf(values));
    }

    public static Relation aliased(Relation relation, String alias, List<String> columnAliases)
    {
        return new AliasedRelation(relation, alias, columnAliases);
    }
View Full Code Here

Examples of org.codehaus.jparsec.examples.sql.ast.AliasedRelation

    assertParser(TABLE, "a.b", table("a", "b"));
  }
 
  public void testAliasable() {
    Parser<Relation> parser = RelationParser.aliasable(TABLE);
    assertParser(parser, "table t", new AliasedRelation(table("table"), "t"));
    assertParser(parser, "table as t", new AliasedRelation(table("table"), "t"));
    assertParser(parser, "table", table("table"));
  }
View Full Code Here

Examples of org.codehaus.jparsec.examples.sql.ast.AliasedRelation

 
  public void testJoin() {
    Parser<Relation> parser = RelationParser.join(TABLE, NUMBER);
    assertParser(parser, "a", table("a"));
    assertParser(parser, "a cross join table2 as b",
        new CrossJoinRelation(table("a"), new AliasedRelation(table("table2"), "b")));
    assertParser(parser, "a inner join b on 1",
        new JoinRelation(table("a"), JoinType.INNER, table("b"), number(1)));
    assertParser(parser, "a inner join b on 1 left join c on 2 cross join d",
        new CrossJoinRelation(
            new JoinRelation(
View Full Code Here

Examples of org.codehaus.jparsec.examples.sql.ast.AliasedRelation

  }
 
  public void testFromClause() {
    Parser<List<Relation>> parser = RelationParser.fromClause(TABLE);
    assertListParser(parser, "from a", table("a"));
    assertListParser(parser, "from a x", new AliasedRelation(table("a"), "x"));
    assertListParser(parser, "from table1 t1, t2",
        new AliasedRelation(table("table1"), "t1"), table("t2"));
  }
View Full Code Here

Examples of org.codehaus.jparsec.examples.sql.ast.AliasedRelation

            Arrays.asList(table("t")),
            null, null, null));
    assertParser(parser, "select 1 from (select * from table) t",
        new Select(false,
            Arrays.asList(new Projection(number(1), null)),
            Arrays.<Relation>asList(new AliasedRelation(
                new Select(false,
                    Arrays.asList(new Projection(ExpressionParserTest.wildcard(), null)),
                    Arrays.asList(table("table")),
                    null, null, null),
                "t")),
View Full Code Here

Examples of org.codehaus.jparsec.examples.sql.ast.AliasedRelation

  }

  @Test
  public void testAliasable() {
    Parser<Relation> parser = RelationParser.aliasable(TABLE);
    assertParser(parser, "table t", new AliasedRelation(table("table"), "t"));
    assertParser(parser, "table as t", new AliasedRelation(table("table"), "t"));
    assertParser(parser, "table", table("table"));
  }
View Full Code Here

Examples of org.codehaus.jparsec.examples.sql.ast.AliasedRelation

  @Test
  public void testJoin() {
    Parser<Relation> parser = RelationParser.join(TABLE, NUMBER);
    assertParser(parser, "a", table("a"));
    assertParser(parser, "a cross join table2 as b",
        new CrossJoinRelation(table("a"), new AliasedRelation(table("table2"), "b")));
    assertParser(parser, "a inner join b on 1",
        new JoinRelation(table("a"), JoinType.INNER, table("b"), number(1)));
    assertParser(parser, "a inner join b on 1 left join c on 2 cross join d",
        new CrossJoinRelation(
            new JoinRelation(
View Full Code Here

Examples of org.codehaus.jparsec.examples.sql.ast.AliasedRelation

  @Test
  public void testFromClause() {
    Parser<List<Relation>> parser = RelationParser.fromClause(TABLE);
    assertListParser(parser, "from a", table("a"));
    assertListParser(parser, "from a x", new AliasedRelation(table("a"), "x"));
    assertListParser(parser, "from table1 t1, t2",
        new AliasedRelation(table("table1"), "t1"), table("t2"));
  }
View Full Code Here

Examples of org.codehaus.jparsec.examples.sql.ast.AliasedRelation

            Arrays.asList(table("t")),
            null, null, null));
    assertParser(parser, "select 1 from (select * from table) t",
        new Select(false,
            Arrays.asList(new Projection(number(1), null)),
            Arrays.<Relation>asList(new AliasedRelation(
                new Select(false,
                    Arrays.asList(new Projection(ExpressionParserTest.wildcard(), null)),
                    Arrays.asList(table("table")),
                    null, null, null),
                "t")),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.