use of org.apache.calcite.plan.RelOptNode in project dingo by dingodb.
the class TestPhysicalPlan method testGetByKeys1.
@Test
public void testGetByKeys1() throws SqlParseException {
String sql = "select * from test1 where id0 = 1 and id1 = 'A' and id2 = true";
RelNode relNode = parse(sql);
RelOptNode r = Assert.relNode(relNode).isA(EnumerableRoot.class).convention(EnumerableConvention.INSTANCE).singleInput().isA(DingoCoalesce.class).convention(DingoConventions.ROOT).singleInput().isA(DingoExchange.class).convention(DingoConventions.PARTITIONED).singleInput().isA(DingoGetByKeys.class).convention(DingoConventions.DISTRIBUTED).getInstance();
assertThat((((DingoGetByKeys) r).getKeyTuples())).containsExactlyInAnyOrder(new Object[] { 1, "A", true });
}
use of org.apache.calcite.plan.RelOptNode in project dingo by dingodb.
the class TestPhysicalPlan method testGetByKeys2.
@Test
public void testGetByKeys2() throws SqlParseException {
String sql = "select * from test1 where id0 = 1 and id1 = 'A' and not id2";
RelNode relNode = parse(sql);
RelOptNode r = Assert.relNode(relNode).isA(EnumerableRoot.class).convention(EnumerableConvention.INSTANCE).singleInput().isA(DingoCoalesce.class).convention(DingoConventions.ROOT).singleInput().isA(DingoExchange.class).convention(DingoConventions.PARTITIONED).singleInput().isA(DingoGetByKeys.class).convention(DingoConventions.DISTRIBUTED).getInstance();
assertThat((((DingoGetByKeys) r).getKeyTuples())).containsExactlyInAnyOrder(new Object[] { 1, "A", false });
}
Aggregations