use of io.dingodb.calcite.rel.DingoPartScan 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 io.dingodb.calcite.rel.DingoPartScan 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 io.dingodb.calcite.rel.DingoPartScan 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 io.dingodb.calcite.rel.DingoPartScan 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();
}
use of io.dingodb.calcite.rel.DingoPartScan in project dingo by dingodb.
the class TestDingoJobVisitor method testVisitPartScan.
@Test
public void testVisitPartScan() {
RelOptCluster cluster = parser.getCluster();
DingoPartScan partScan = new DingoPartScan(cluster, cluster.traitSetOf(DingoConventions.DISTRIBUTED), table);
Job job = DingoJobVisitor.createJob(partScan);
Assert.job(job).taskNum(2).task(0, t -> t.operatorNum(1).location(MockMetaServiceProvider.LOC_0).soleSource().isPartScan(TABLE_ID, "0").soleOutput().isNull()).task(1, t -> t.operatorNum(1).location(MockMetaServiceProvider.LOC_1).soleSource().isPartScan(TABLE_ID, "1").soleOutput().isNull());
}
Aggregations