Search in sources :

Example 1 with ExecNodeGraphGenerator

use of org.apache.flink.table.planner.plan.nodes.exec.ExecNodeGraphGenerator in project flink by apache.

the class MultipleInputNodeCreationProcessorTest method assertChainableSource.

private void assertChainableSource(String name, TableTestUtil util, boolean expected) {
    String sql = "SELECT * FROM " + name;
    Table table = util.tableEnv().sqlQuery(sql);
    RelNode relNode = TableTestUtil.toRelNode(table);
    FlinkPhysicalRel optimizedRel = (FlinkPhysicalRel) util.getPlanner().optimize(relNode);
    ExecNodeGraphGenerator generator = new ExecNodeGraphGenerator();
    ExecNodeGraph execGraph = generator.generate(Collections.singletonList(optimizedRel));
    ExecNode<?> execNode = execGraph.getRootNodes().get(0);
    while (!execNode.getInputEdges().isEmpty()) {
        execNode = execNode.getInputEdges().get(0).getSource();
    }
    ProcessorContext context = new ProcessorContext(util.getPlanner());
    Assert.assertEquals(expected, MultipleInputNodeCreationProcessor.isChainableSource(execNode, context));
}
Also used : ExecNodeGraph(org.apache.flink.table.planner.plan.nodes.exec.ExecNodeGraph) Table(org.apache.flink.table.api.Table) RelNode(org.apache.calcite.rel.RelNode) ExecNodeGraphGenerator(org.apache.flink.table.planner.plan.nodes.exec.ExecNodeGraphGenerator) FlinkPhysicalRel(org.apache.flink.table.planner.plan.nodes.physical.FlinkPhysicalRel)

Aggregations

RelNode (org.apache.calcite.rel.RelNode)1 Table (org.apache.flink.table.api.Table)1 ExecNodeGraph (org.apache.flink.table.planner.plan.nodes.exec.ExecNodeGraph)1 ExecNodeGraphGenerator (org.apache.flink.table.planner.plan.nodes.exec.ExecNodeGraphGenerator)1 FlinkPhysicalRel (org.apache.flink.table.planner.plan.nodes.physical.FlinkPhysicalRel)1