Package org.teiid.query.optimizer.relational.plantree

Examples of org.teiid.query.optimizer.relational.plantree.PlanNode.addGroups()


      newJoinNode.addLastChild(otherBranchSource);
     
      newJoinNode.setProperty(Info.JOIN_STRATEGY, JoinStrategyType.NESTED_LOOP);
      newJoinNode.setProperty(Info.JOIN_TYPE, JoinType.JOIN_INNER);
      newJoinNode.setProperty(Info.JOIN_CRITERIA, LanguageObject.Util.deepClone(criteria, Criteria.class));
      newJoinNode.addGroups(branchSource.getGroups());
      newJoinNode.addGroups(otherBranchSource.getGroups());
     
      PlanNode projectPlanNode = NodeFactory.getNewNode(NodeConstants.Types.PROJECT);
      newJoinNode.addAsParent(projectPlanNode);
     
View Full Code Here


     
      newJoinNode.setProperty(Info.JOIN_STRATEGY, JoinStrategyType.NESTED_LOOP);
      newJoinNode.setProperty(Info.JOIN_TYPE, JoinType.JOIN_INNER);
      newJoinNode.setProperty(Info.JOIN_CRITERIA, LanguageObject.Util.deepClone(criteria, Criteria.class));
      newJoinNode.addGroups(branchSource.getGroups());
      newJoinNode.addGroups(otherBranchSource.getGroups());
     
      PlanNode projectPlanNode = NodeFactory.getNewNode(NodeConstants.Types.PROJECT);
      newJoinNode.addAsParent(projectPlanNode);
     
      Select allSymbols = new Select(symbolMap.getKeys());
View Full Code Here

      allSymbols.addSymbols(otherSymbolMap.getKeys());
      if (i == 0) {
        QueryRewriter.makeSelectUnique(allSymbols, false);
      }
      projectPlanNode.setProperty(NodeConstants.Info.PROJECT_COLS, allSymbols.getSymbols());
          projectPlanNode.addGroups(newJoinNode.getGroups());
     
      joins.add(projectPlanNode);
    }
   
    PlanNode newUnion = RulePlanUnions.buildUnionTree(unionNode, joins);
View Full Code Here

      OrderBy elements = (OrderBy)sort.getProperty(NodeConstants.Info.SORT_ORDER);
      for (OrderByItem item : elements.getOrderByItems()) {
        item.setSymbol(childProject.get(selectSymbols.indexOf(item.getSymbol())));
      }
        sort.getGroups().clear();
        sort.addGroups(GroupsUsedByElementsVisitor.getGroups(elements));
    }
  }
   
    /**
     * Check to ensure that we are not projecting a subquery or null dependent expressions
View Full Code Here

        joinNode.setProperty(NodeConstants.Info.MODEL_ID, modelID);

    // Insert new access node above join node
    PlanNode newAccess = NodeFactory.getNewNode(NodeConstants.Types.ACCESS);
    newAccess.setProperty(NodeConstants.Info.MODEL_ID, modelID);
    newAccess.addGroups(rightAccess.getGroups());
    newAccess.addGroups(leftAccess.getGroups());
       
        // Combine hints if necessary
        Object leftHint = leftAccess.getProperty(NodeConstants.Info.MAKE_DEP);
        if(leftHint != null) {
View Full Code Here

    // Insert new access node above join node
    PlanNode newAccess = NodeFactory.getNewNode(NodeConstants.Types.ACCESS);
    newAccess.setProperty(NodeConstants.Info.MODEL_ID, modelID);
    newAccess.addGroups(rightAccess.getGroups());
    newAccess.addGroups(leftAccess.getGroups());
       
        // Combine hints if necessary
        Object leftHint = leftAccess.getProperty(NodeConstants.Info.MAKE_DEP);
        if(leftHint != null) {
            newAccess.setProperty(NodeConstants.Info.MAKE_DEP, leftHint);
View Full Code Here

                return current;
              }
      }
           
            PlanNode semiJoin = NodeFactory.getNewNode(NodeConstants.Types.JOIN);
            semiJoin.addGroups(current.getGroups());
            semiJoin.setProperty(NodeConstants.Info.JOIN_STRATEGY, JoinStrategyType.MERGE);
            semiJoin.setProperty(NodeConstants.Info.JOIN_TYPE, plannedResult.not?JoinType.JOIN_ANTI_SEMI:JoinType.JOIN_SEMI);
            semiJoin.setProperty(NodeConstants.Info.NON_EQUI_JOIN_CRITERIA, plannedResult.nonEquiJoinCriteria);
           
            semiJoin.setProperty(NodeConstants.Info.LEFT_EXPRESSIONS, plannedResult.leftExpressions);
View Full Code Here

            newCols = RelationalNode.projectTuple(filteredIndex, projectCols);
           
            projectNode.setProperty(NodeConstants.Info.PROJECT_COLS, newCols);
            if (updateGroups) {
              projectNode.getGroups().clear();
              projectNode.addGroups(GroupsUsedByElementsVisitor.getGroups(newCols));
              projectNode.addGroups(GroupsUsedByElementsVisitor.getGroups(projectNode.getCorrelatedReferenceElements()));
            }
        }
       
        if (!updateGroups) {
View Full Code Here

           
            projectNode.setProperty(NodeConstants.Info.PROJECT_COLS, newCols);
            if (updateGroups) {
              projectNode.getGroups().clear();
              projectNode.addGroups(GroupsUsedByElementsVisitor.getGroups(newCols));
              projectNode.addGroups(GroupsUsedByElementsVisitor.getGroups(projectNode.getCorrelatedReferenceElements()));
            }
        }
       
        if (!updateGroups) {
          for (int i : filteredIndex) {
View Full Code Here

            for (Map.Entry<PlanNode, PlanNode> entry : combined.entrySet()) {
                PlanNode joinSourceRoot = entry.getValue();
                if (root.getChildCount() == 2) {
                    PlanNode parentJoin = RulePlanJoins.createJoinNode();
                    parentJoin.addFirstChild(root);
                    parentJoin.addGroups(root.getGroups());
                    root = parentJoin;
                }
                root.addLastChild(joinSourceRoot);
                root.addGroups(entry.getKey().getGroups());
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.