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(
new JoinRelation(table("a"), JoinType.INNER, table("b"), number(1))
, JoinType.LEFT, table("c"), number(2)),
table("d")));
assertParser(parser, "a cross join b inner join c right join d on 1 on 2",
new JoinRelation(new CrossJoinRelation(table("a"), table("b")),
JoinType.INNER,
new JoinRelation(table("c"), JoinType.RIGHT, table("d"), number(1)),
number(2)));
assertParser(parser, "a cross join (b FULL join c on 1)",
new CrossJoinRelation(table("a"),
new JoinRelation(table("b"), JoinType.FULL, table("c"), number(1))));
}