Search in sources :

Example 21 with JoinType

use of org.teiid.query.sql.lang.JoinType in project teiid by teiid.

the class RulePushSelectCriteria method handleJoinCriteria.

/**
 * Handles multi-group criteria originating at the given joinNode
 *
 * @param joinNode
 * @param critNode
 * @return
 */
private boolean handleJoinCriteria(PlanNode joinNode, PlanNode critNode, QueryMetadataInterface metadata) {
    JoinType jt = (JoinType) joinNode.getProperty(NodeConstants.Info.JOIN_TYPE);
    if (jt == JoinType.JOIN_CROSS || jt == JoinType.JOIN_INNER) {
        return moveCriteriaIntoOnClause(critNode, joinNode);
    }
    JoinType optimized = JoinUtil.optimizeJoinType(critNode, joinNode, metadata, true);
    if (optimized == JoinType.JOIN_INNER) {
        moveCriteriaIntoOnClause(critNode, joinNode);
        // return true since the join type has changed
        return true;
    }
    return false;
}
Also used : JoinType(org.teiid.query.sql.lang.JoinType)

Aggregations

JoinType (org.teiid.query.sql.lang.JoinType)21 PlanNode (org.teiid.query.optimizer.relational.plantree.PlanNode)17 List (java.util.List)11 Criteria (org.teiid.query.sql.lang.Criteria)10 GroupSymbol (org.teiid.query.sql.symbol.GroupSymbol)10 ArrayList (java.util.ArrayList)9 Expression (org.teiid.query.sql.symbol.Expression)8 CompareCriteria (org.teiid.query.sql.lang.CompareCriteria)6 LinkedList (java.util.LinkedList)5 SymbolMap (org.teiid.query.sql.util.SymbolMap)5 ElementSymbol (org.teiid.query.sql.symbol.ElementSymbol)4 LinkedHashSet (java.util.LinkedHashSet)3 IsNullCriteria (org.teiid.query.sql.lang.IsNullCriteria)3 Collection (java.util.Collection)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 Iterator (java.util.Iterator)2 LinkedHashMap (java.util.LinkedHashMap)2 Set (java.util.Set)2 OrderBy (org.teiid.query.sql.lang.OrderBy)2