Search in sources :

Example 1 with BiRel

use of org.apache.calcite.rel.BiRel in project samza by apache.

the class SamzaSqlApplicationConfig method populateSystemStreams.

private static void populateSystemStreams(RelNode relNode, List<String> inputSystemStreams, List<String> outputSystemStreams) {
    if (relNode instanceof TableModify) {
        outputSystemStreams.add(getSystemStreamName(relNode));
    } else {
        if (relNode instanceof BiRel) {
            BiRel biRelNode = (BiRel) relNode;
            populateSystemStreams(biRelNode.getLeft(), inputSystemStreams, outputSystemStreams);
            populateSystemStreams(biRelNode.getRight(), inputSystemStreams, outputSystemStreams);
        } else {
            if (relNode.getTable() != null) {
                inputSystemStreams.add(getSystemStreamName(relNode));
            }
        }
    }
    List<RelNode> relNodes = relNode.getInputs();
    if (relNodes == null || relNodes.isEmpty()) {
        return;
    }
    relNodes.forEach(node -> populateSystemStreams(node, inputSystemStreams, outputSystemStreams));
}
Also used : BiRel(org.apache.calcite.rel.BiRel) RelNode(org.apache.calcite.rel.RelNode) TableModify(org.apache.calcite.rel.core.TableModify)

Aggregations

BiRel (org.apache.calcite.rel.BiRel)1 RelNode (org.apache.calcite.rel.RelNode)1 TableModify (org.apache.calcite.rel.core.TableModify)1