use of io.dingodb.calcite.rel.DingoCoalesce in project dingo by dingodb.
the class DingoCoalesceRule method onMatch.
@Override
public void onMatch(@Nonnull RelOptRuleCall call) {
RelNode rel = call.rel(0);
RelOptCluster cluster = rel.getCluster();
call.transformTo(new DingoCoalesce(cluster, rel.getTraitSet().replace(DingoConventions.ROOT), rel));
}
use of io.dingodb.calcite.rel.DingoCoalesce in project dingo by dingodb.
the class TestDingoJobVisitor method testVisitCoalesce.
@Test
public void testVisitCoalesce() {
RelOptCluster cluster = parser.getCluster();
DingoCoalesce coalesce = new DingoCoalesce(cluster, cluster.traitSetOf(DingoConventions.ROOT), new DingoExchange(cluster, cluster.traitSetOf(DingoConventions.PARTITIONED), new DingoPartScan(cluster, cluster.traitSetOf(DingoConventions.DISTRIBUTED), table)));
Job job = DingoJobVisitor.createJob(coalesce);
Assert.job(job).taskNum(2).task(0, t -> t.operatorNum(3).location(MockMetaServiceProvider.LOC_0).sourceNum(2).source(0, s -> s.isPartScan(TABLE_ID, "0").soleOutput().isA(CoalesceOperator.class)).source(1, s -> s.isA(ReceiveOperator.class).soleOutput().isA(CoalesceOperator.class))).task(1, t -> t.operatorNum(2).location(MockMetaServiceProvider.LOC_1).soleSource().isPartScan(TABLE_ID, "1").soleOutput().isA(SendOperator.class));
}
Aggregations