use of com.facebook.presto.sql.planner.optimizations.joins.JoinGraph in project presto by prestodb.
the class TestEliminateCrossJoins method testJoinOrderWithRealCrossJoin.
@Test
public void testJoinOrderWithRealCrossJoin() {
PlanNode leftPlan = join(join(values(symbol("a")), values(symbol("b"))), values(symbol("c")), symbol("a"), symbol("c"), symbol("c"), symbol("b"));
PlanNode rightPlan = join(join(values(symbol("x")), values(symbol("y"))), values(symbol("z")), symbol("x"), symbol("z"), symbol("z"), symbol("y"));
PlanNode plan = join(leftPlan, rightPlan);
JoinGraph joinGraph = getOnlyElement(JoinGraph.buildFrom(plan));
assertEquals(EliminateCrossJoins.getJoinOrder(joinGraph), ImmutableList.of(0, 2, 1, 3, 5, 4));
}
use of com.facebook.presto.sql.planner.optimizations.joins.JoinGraph in project presto by prestodb.
the class TestEliminateCrossJoins method testJoinOrderWithMultipleEdgesBetweenNodes.
@Test
public void testJoinOrderWithMultipleEdgesBetweenNodes() {
PlanNode plan = join(join(values(symbol("a")), values(symbol("b1"), symbol("b2"))), values(symbol("c1"), symbol("c2")), symbol("a"), symbol("c1"), symbol("c1"), symbol("b1"), symbol("c2"), symbol("b2"));
JoinGraph joinGraph = getOnlyElement(JoinGraph.buildFrom(plan));
assertEquals(EliminateCrossJoins.getJoinOrder(joinGraph), ImmutableList.of(0, 2, 1));
}
Aggregations