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));
}
Aggregations