Package org.teiid.query.optimizer.relational

Examples of org.teiid.query.optimizer.relational.RelationalPlanner


   
    @Test public void testPushAcrossFrameWithAccessNode() throws Exception {
      QueryMetadataInterface metadata = new TempMetadataAdapter(FakeMetadataFactory.example1Cached(), new TempMetadataStore());
      Command command = TestOptimizer.helpGetCommand("select * from (select * from pm1.g1 union select * from pm1.g2) x where e1 = 1", metadata, null); //$NON-NLS-1$
      Command subCommand = TestOptimizer.helpGetCommand("select * from pm1.g1 union select * from pm1.g2", metadata, null); //$NON-NLS-1$
      RelationalPlanner p = new RelationalPlanner();
      CommandContext cc = new CommandContext();
      p.initialize(command, null, metadata, null, null, cc);
      PlanNode root = p.generatePlan(command);
      PlanNode child = p.generatePlan(subCommand);
      PlanNode sourceNode = NodeEditor.findNodePreOrder(root, NodeConstants.Types.SOURCE);
      sourceNode.addFirstChild(child);
        sourceNode.setProperty(NodeConstants.Info.SYMBOL_MAP, SymbolMap.createSymbolMap(sourceNode.getGroups().iterator().next(), (List<SingleElementSymbol>)child.getFirstChild().getProperty(Info.PROJECT_COLS), metadata));
      //add a dummy access node
        PlanNode accessNode = NodeFactory.getNewNode(NodeConstants.Types.ACCESS);
View Full Code Here


    default:
      try {
        if (command.getType() == Command.TYPE_QUERY && command instanceof Query && QueryResolver.isXMLQuery((Query)command, metadata)) {
          result = XML_PLANNER.optimize(command, idGenerator, metadata, capFinder, analysisRecord, context);
        } else {
          RelationalPlanner planner = new RelationalPlanner();
          planner.initialize(command, idGenerator, metadata, capFinder, analysisRecord, context);
          result = planner.optimize(command);
        }
      } catch (QueryResolverException e) {
        throw new TeiidRuntimeException(e);
      }
        }
View Full Code Here

  private PlanNode helpPlan(String command) throws Exception {
    Command query = QueryParser.getQueryParser().parseCommand(command);
    QueryResolver.resolveCommand(query, METADATA);
   
    //Generate canonical plan
      RelationalPlanner p = new RelationalPlanner();
      p.initialize(query, null, METADATA, FINDER, null, new CommandContext());
      PlanNode planNode = p.generatePlan(query);
      RelationalPlanner planner = new RelationalPlanner();
    final RuleStack rules = planner.buildRules();

    PlanNode testPlan = helpExecuteRules(rules, planNode, METADATA, DEBUG);
   
    return testPlan;
  }
View Full Code Here

TOP

Related Classes of org.teiid.query.optimizer.relational.RelationalPlanner

Copyright © 2018 www.massapicom. 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.