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

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


    return newUnion;
  }

  static PlanNode createSource(GroupSymbol group, PlanNode unionNode, SymbolMap symbolMap) {
    PlanNode branchSource = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
    branchSource.addGroup(group);
    PlanNode projectNode = NodeEditor.findNodePreOrder(unionNode, NodeConstants.Types.PROJECT);
    branchSource.setProperty(Info.SYMBOL_MAP, SymbolMap.createSymbolMap(symbolMap.getKeys(), (List<? extends SingleElementSymbol>)projectNode.getProperty(Info.PROJECT_COLS)));
    unionNode.addAsParent(branchSource);
    return branchSource;
  }
View Full Code Here


        group.setMetadataID(METADATA.getGroupID("pm4.g2")); //$NON-NLS-1$
               
        PlanNode n1 = NodeFactory.getNewNode(NodeConstants.Types.ACCESS);
        n1.setProperty(NodeConstants.Info.ATOMIC_REQUEST, query);
        n1.addGroup(group);
       
        RulePlaceAccess.addAccessPatternsProperty(n1, METADATA);

        Collection accessPatterns = (Collection)n1.getProperty(NodeConstants.Info.ACCESS_PATTERNS);
        assertNotNull(accessPatterns);
View Full Code Here

        //create proper names for the aggregate symbols
        Select select = new Select(projectedViewSymbols);
        QueryRewriter.makeSelectUnique(select, false);
        projectedViewSymbols = select.getProjectedSymbols();
        projectPlanNode.setProperty(NodeConstants.Info.PROJECT_COLS, projectedViewSymbols);
        projectPlanNode.addGroup(group);
        if (pushdown) {
          while (RuleRaiseAccess.raiseAccessNode(root, originalNode, metadata, capFinder, true, null) != null) {
            //continue to raise
          }
        }
View Full Code Here

  static PlanNode createView(GroupSymbol group, List<? extends SingleElementSymbol> virtualElements, PlanNode child, QueryMetadataInterface metadata) throws TeiidComponentException {
    PlanNode intermediateView = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
      SymbolMap symbolMap = createSymbolMap(group, virtualElements, child, metadata);
      intermediateView.setProperty(NodeConstants.Info.SYMBOL_MAP, symbolMap);
      child.addAsParent(intermediateView);
      intermediateView.addGroup(group);
      return intermediateView;
  }

  private static SymbolMap createSymbolMap(GroupSymbol group,
      List<? extends SingleElementSymbol> virtualElements,
View Full Code Here

        if (command instanceof ProcedureContainer) {
          ProcedureContainer container = (ProcedureContainer)command;
          usingTriggerAction = addNestedProcedure(sourceNode, container, container.getGroup().getMetadataID());
        }
        GroupSymbol target = ((TargetedCommand)command).getGroup();
        sourceNode.addGroup(target);
      Object id = getTrackableGroup(target, metadata);
      if (id != null) {
        context.accessedPlanningObject(id);
      }
        attachLast(projectNode, sourceNode);
View Full Code Here

      addNestedProcedure(sourceNode, storedProc, storedProc.getProcedureID());
       
        hints.hasRelationalProc |= storedProc.isProcedureRelational();

        // Set group on source node
        sourceNode.addGroup(storedProc.getGroup());

        attachLast(projectNode, sourceNode);

        return projectNode;
    }
View Full Code Here

            }
            node = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
            if (group.getModelMetadataId() != null) {
              node.setProperty(Info.MODEL_ID, group.getModelMetadataId());
            }
            node.addGroup(group);
            if (nestedCommand != null) {
              UpdateInfo info = ProcedureContainerResolver.getUpdateInfo(group, metadata);
              if (info != null && info.getPartitionInfo() != null && !info.getPartitionInfo().isEmpty()) {
                node.setProperty(NodeConstants.Info.PARTITION_INFO, info.getPartitionInfo());
              }
View Full Code Here

            Command nestedCommand = sfc.getCommand();
            node = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
            if (sfc.isTable()) {
            sfc.getCommand().setCorrelatedReferences(getCorrelatedReferences(parent, node, sfc));
            }
            node.addGroup(group);
            addNestedCommand(node, group, nestedCommand, nestedCommand, true);
      if (nestedCommand instanceof SetQuery) {
        Map<ElementSymbol, List<Set<Constant>>> partitionInfo = PartitionAnalyzer.extractPartionInfo((SetQuery)nestedCommand, ResolverUtil.resolveElementsInGroup(group, metadata));
        if (!partitionInfo.isEmpty()) {
          node.setProperty(NodeConstants.Info.PARTITION_INFO, partitionInfo);
View Full Code Here

          TableFunctionReference tt = (TableFunctionReference)clause;
            GroupSymbol group = tt.getGroupSymbol();
            node = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
            node.setProperty(NodeConstants.Info.TABLE_FUNCTION, tt);
            tt.setCorrelatedReferences(getCorrelatedReferences(parent, node, tt));
            node.addGroup(group);
            parent.addLastChild(node);
        }
       
        if (clause.isOptional()) {
            node.setProperty(NodeConstants.Info.IS_OPTIONAL, Boolean.TRUE);
View Full Code Here

      PlanNode projectNode = NodeFactory.getNewNode(NodeConstants.Types.PROJECT);
      ElementSymbol e1 = new ElementSymbol("e1"); //$NON-NLS-1$
      e1.setGroupSymbol(getGroup(3));
      projectNode.setProperty(Info.PROJECT_COLS, Arrays.asList(e1));
      projectNode.addFirstChild(joinNode);
      projectNode.addGroup(getGroup(3));
      PlanNode sourceNode = NodeFactory.getNewNode(NodeConstants.Types.SOURCE);
      sourceNode.addFirstChild(projectNode);
      GroupSymbol four = getGroup(4);
      sourceNode.addGroup(four);
      ElementSymbol e2 = new ElementSymbol("e2"); //$NON-NLS-1$
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.