Package org.teiid.query.sql.util

Examples of org.teiid.query.sql.util.SymbolMap.addMapping()


        if (updateGroups) {
          SymbolMap newMap = new SymbolMap();
            List<Expression> originalExpressionOrder = symbolMap.getValues();

          for (int i = 0; i < filteredIndex.length; i++) {
            newMap.addMapping(originalOrder.get(filteredIndex[i]), originalExpressionOrder.get(filteredIndex[i]));
      }
            PlanNode sortNode = NodeEditor.findNodePreOrder(sourceNode, NodeConstants.Types.SORT, NodeConstants.Types.PROJECT);
          if (sortNode != null) {
            OrderBy elements = (OrderBy) sortNode.getProperty(NodeConstants.Info.SORT_ORDER);
            for (OrderByItem item : elements.getOrderByItems()) {
View Full Code Here


        if (childProjects != null) {
            SymbolMap symbolMap = (SymbolMap)sourceNode.getProperty(NodeConstants.Info.SYMBOL_MAP);

            SymbolMap replacementMap = new SymbolMap();
            for (Map.Entry<ElementSymbol, Expression> entry : symbolMap.asMap().entrySet()) {
                replacementMap.addMapping((ElementSymbol)replacementSymbols.get(entry.getKey()), entry.getValue());
            }
            sourceNode.setProperty(NodeConstants.Info.SYMBOL_MAP, replacementMap);
        }

    }
View Full Code Here

                ProcessorPlan procPlan = QueryOptimizer.optimizePlan(subCommand, metadata, idGenerator, capFinder, analysisRecord, context);
                container.getCommand().setProcessorPlan(procPlan);
                if (!correlatedReferences.isEmpty()) {
                  SymbolMap map = new SymbolMap();
                  for (Reference reference : correlatedReferences) {
              map.addMapping(reference.getExpression(), reference.getExpression());
            }
                  container.getCommand().setCorrelatedReferences(map);
                }
            }
            node.addGroups(GroupsUsedByElementsVisitor.getGroups(node.getCorrelatedReferenceElements()));
View Full Code Here

    if (correlatedReferences.isEmpty()) {
      return null;
    }
      SymbolMap map = new SymbolMap();
      for (Reference reference : correlatedReferences) {
      map.addMapping(reference.getExpression(), reference.getExpression());
    }
      node.setProperty(NodeConstants.Info.CORRELATED_REFERENCES, map);
      return map;
  }
View Full Code Here

        ArrayList<Reference> correlatedReferences = new ArrayList<Reference>();
        CorrelatedReferenceCollectorVisitor.collectReferences(plannedResult.query, groups, correlatedReferences);
        if (!correlatedReferences.isEmpty()) {
                SymbolMap map = new SymbolMap();
                for (Reference reference : correlatedReferences) {
            map.addMapping(reference.getExpression(), reference.getExpression());
          }
                plannedResult.query.setCorrelatedReferences(map);
           
      }
      boolean requiresDistinct = requiresDistinctRows(query);
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.