use of org.apache.calcite.plan.RelOptNode in project dingo by dingodb.
the class TestPhysicalPlan method testProjectScan.
@Test
public void testProjectScan() throws SqlParseException {
String sql = "select name, amount from test";
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(DingoPartScan.class).convention(DingoConventions.DISTRIBUTED).getInstance();
DingoPartScan scan = (DingoPartScan) r;
assertThat((scan).getFilter()).isNull();
assertThat((scan).getSelection()).isNotNull();
}
use of org.apache.calcite.plan.RelOptNode in project dingo by dingodb.
the class TestPhysicalPlan method testGetByKeys3.
@Test
public void testGetByKeys3() throws SqlParseException {
String sql = "select * from test1 where (id0 = 1 or id0 = 2) and (id1 = 'A' or id1 = 'B') and 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", true }, new Object[] { 1, "B", true }, new Object[] { 2, "A", true }, new Object[] { 2, "B", true });
}
use of org.apache.calcite.plan.RelOptNode in project dingo by dingodb.
the class TestPhysicalPlan method testFilterScan.
@Test
public void testFilterScan() throws SqlParseException {
String sql = "select * from test where name = 'Alice' and amount > 3.0";
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(DingoPartScan.class).convention(DingoConventions.DISTRIBUTED).getInstance();
DingoPartScan scan = (DingoPartScan) r;
assertThat((scan).getFilter()).isNotNull();
assertThat((scan).getSelection()).isNull();
}
use of org.apache.calcite.plan.RelOptNode in project dingo by dingodb.
the class TestPhysicalPlan method testGetByKeys.
@Test
public void testGetByKeys() throws SqlParseException {
String sql = "select * from test1 where id0 = 1";
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(DingoPartScan.class).convention(DingoConventions.DISTRIBUTED).getInstance();
DingoPartScan scan = (DingoPartScan) r;
assertThat((scan).getFilter()).isNotNull();
assertThat((scan).getSelection()).isNull();
}
use of org.apache.calcite.plan.RelOptNode in project dingo by dingodb.
the class TestPhysicalPlan method testFullScan.
@Test
public void testFullScan() throws SqlParseException {
String sql = "select * from test";
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(DingoPartScan.class).convention(DingoConventions.DISTRIBUTED).getInstance();
DingoPartScan scan = (DingoPartScan) r;
assertThat((scan).getFilter()).isNull();
assertThat((scan).getSelection()).isNull();
}
Aggregations