Search in sources :

Example 1 with CommonIntermediateTableScan

use of org.apache.flink.table.planner.plan.nodes.common.CommonIntermediateTableScan in project flink by apache.

the class ExecNodeGraphGenerator method generate.

private ExecNode<?> generate(FlinkPhysicalRel rel) {
    ExecNode<?> execNode = visitedRels.get(rel);
    if (execNode != null) {
        return execNode;
    }
    if (rel instanceof CommonIntermediateTableScan) {
        throw new TableException("Intermediate RelNode can't be converted to ExecNode.");
    }
    List<ExecNode<?>> inputNodes = new ArrayList<>();
    for (RelNode input : rel.getInputs()) {
        inputNodes.add(generate((FlinkPhysicalRel) input));
    }
    execNode = rel.translateToExecNode();
    // connects the input nodes
    List<ExecEdge> inputEdges = new ArrayList<>(inputNodes.size());
    for (ExecNode<?> inputNode : inputNodes) {
        inputEdges.add(ExecEdge.builder().source(inputNode).target(execNode).build());
    }
    execNode.setInputEdges(inputEdges);
    visitedRels.put(rel, execNode);
    return execNode;
}
Also used : CommonIntermediateTableScan(org.apache.flink.table.planner.plan.nodes.common.CommonIntermediateTableScan) TableException(org.apache.flink.table.api.TableException) RelNode(org.apache.calcite.rel.RelNode) ArrayList(java.util.ArrayList) FlinkPhysicalRel(org.apache.flink.table.planner.plan.nodes.physical.FlinkPhysicalRel)

Aggregations

ArrayList (java.util.ArrayList)1 RelNode (org.apache.calcite.rel.RelNode)1 TableException (org.apache.flink.table.api.TableException)1 CommonIntermediateTableScan (org.apache.flink.table.planner.plan.nodes.common.CommonIntermediateTableScan)1 FlinkPhysicalRel (org.apache.flink.table.planner.plan.nodes.physical.FlinkPhysicalRel)1