use of io.confluent.ksql.planner.JoinTree.Join in project ksql by confluentinc.
the class JoinTreeTest method handlesBasicTwoWayJoin.
@Test
public void handlesBasicTwoWayJoin() {
// Given:
when(j1.getLeftSource()).thenReturn(a);
when(j1.getRightSource()).thenReturn(b);
final List<JoinInfo> joins = ImmutableList.of(j1);
// When:
final Node root = JoinTree.build(joins);
// Then:
assertThat(root, instanceOf(Join.class));
assertThat(((Join) root).getLeft(), is(new JoinTree.Leaf(a)));
assertThat(((Join) root).getRight(), is(new JoinTree.Leaf(b)));
assertThat(((Join) root).getInfo(), is(j1));
}
use of io.confluent.ksql.planner.JoinTree.Join in project ksql by confluentinc.
the class JoinTreeTest method handlesLeftThreeWayJoin.
@Test
public void handlesLeftThreeWayJoin() {
// Given:
when(j1.getLeftSource()).thenReturn(a);
when(j1.getRightSource()).thenReturn(b);
when(j2.getLeftSource()).thenReturn(a);
when(j2.getRightSource()).thenReturn(c);
final List<JoinInfo> joins = ImmutableList.of(j1, j2);
// When:
final Node root = JoinTree.build(joins);
// Then:
assertThat(root, instanceOf(Join.class));
assertThat(root, is(new Join(new Join(new Leaf(a), new Leaf(b), j1), new Leaf(c), j2)));
}
Aggregations