Search in sources :

Example 1 with DependentAccessNode

use of org.teiid.query.processor.relational.DependentAccessNode in project teiid by teiid.

the class TestDependentJoins method getDependentGroups.

static void getDependentGroups(RelationalNode node, Set<String> depGroups, boolean depdenent) {
    if (node instanceof AccessNode) {
        if (node instanceof DependentAccessNode) {
            if (!depdenent) {
                return;
            }
        } else if (depdenent) {
            return;
        }
        AccessNode accessNode = (AccessNode) node;
        Command depCommand = accessNode.getCommand();
        Collection<GroupSymbol> groupSymbols = GroupCollectorVisitor.getGroups(depCommand, true);
        for (GroupSymbol groupSymbol : groupSymbols) {
            depGroups.add(groupSymbol.getNonCorrelationName().toUpperCase());
        }
    }
    // Recurse through children
    RelationalNode[] children = node.getChildren();
    for (int i = 0; i < children.length; i++) {
        if (children[i] != null) {
            getDependentGroups(node.getChildren()[i], depGroups, depdenent);
        }
    }
}
Also used : RelationalNode(org.teiid.query.processor.relational.RelationalNode) Command(org.teiid.query.sql.lang.Command) DependentAccessNode(org.teiid.query.processor.relational.DependentAccessNode) GroupSymbol(org.teiid.query.sql.symbol.GroupSymbol) DependentAccessNode(org.teiid.query.processor.relational.DependentAccessNode) AccessNode(org.teiid.query.processor.relational.AccessNode)

Aggregations

AccessNode (org.teiid.query.processor.relational.AccessNode)1 DependentAccessNode (org.teiid.query.processor.relational.DependentAccessNode)1 RelationalNode (org.teiid.query.processor.relational.RelationalNode)1 Command (org.teiid.query.sql.lang.Command)1 GroupSymbol (org.teiid.query.sql.symbol.GroupSymbol)1