Examples of addGroups()


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

    // 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

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

                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

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

            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

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

           
            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

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

            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

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

    boolean first = true;
    List<SingleElementSymbol> symbols = null;
    for (PlanNode planNode : unionChildren) {
      PlanNode groupClone = NodeFactory.getNewNode(NodeConstants.Types.GROUP);
      groupClone.setProperty(Info.GROUP_COLS, LanguageObject.Util.deepClone(groupingExpressions, SingleElementSymbol.class));
      groupClone.addGroups(groupNode.getGroups());
     
      PlanNode view = RuleDecomposeJoin.createSource(group, planNode, parentMap);
     
      view.addAsParent(groupClone);
     
View Full Code Here

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

        first = false;
        QueryRewriter.makeSelectUnique(allSymbols, false);
        symbols = allSymbols.getSymbols();
      }
      projectPlanNode.setProperty(NodeConstants.Info.PROJECT_COLS, allSymbols.getSymbols());
        projectPlanNode.addGroups(view.getGroups());
       
        groupClone.addAsParent(projectPlanNode);
       
        if (planNode.getType() == NodeConstants.Types.ACCESS) {
          //TODO: temporarily remove the access node so that the inline view could be removed if possible
View Full Code Here

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

    PlanNode stageGroup = NodeFactory.getNewNode(NodeConstants.Types.GROUP);
    planNode.addAsParent(stageGroup);

    if (!stagedGroupingSymbols.isEmpty()) {
        stageGroup.setProperty(NodeConstants.Info.GROUP_COLS, new ArrayList<SingleElementSymbol>(stagedGroupingSymbols));
        stageGroup.addGroups(GroupsUsedByElementsVisitor.getGroups(stagedGroupingSymbols));
    } else {
        // if the source has no rows we need to insert a select node with criteria count(*)>0
        PlanNode selectNode = NodeFactory.getNewNode(NodeConstants.Types.SELECT);
        AggregateSymbol count = new AggregateSymbol("stagedAgg", NonReserved.COUNT, false, null); //$NON-NLS-1$
        aggregates.add(count); //consider the count aggregate for the push down call below
View Full Code Here

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

        PlanNode apNode = sourceNode;

        if (sourceNode.getChildCount() == 0) {
            // Create the access node and insert
            PlanNode accessNode = NodeFactory.getNewNode(NodeConstants.Types.ACCESS);
            accessNode.addGroups(sourceNode.getGroups());

            copyDependentHints(sourceNode, accessNode);

            Object hint = sourceNode.removeProperty(NodeConstants.Info.IS_OPTIONAL);
            if (hint != null) {
View Full Code Here

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

        critNode.setProperty(NodeConstants.Info.SELECT_CRITERIA, crit);
        if (isHaving && !AggregateSymbolCollectorVisitor.getAggregates(crit, false).isEmpty()) {
            critNode.setProperty(NodeConstants.Info.IS_HAVING, Boolean.TRUE);
        }
        // Add groups to crit node
        critNode.addGroups(GroupsUsedByElementsVisitor.getGroups(crit));
        critNode.addGroups(GroupsUsedByElementsVisitor.getGroups(critNode.getCorrelatedReferenceElements()));
        return critNode;
    }

  /**
 
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.