Package org.teiid.query.sql.lang

Examples of org.teiid.query.sql.lang.Command


        // Slightly modify metadata to set max set size to just a few rows - this
        // will allow us to test the dependent overflow case
        FakeMetadataFacade fakeMetadata = FakeMetadataFactory.example1Cached();
       
        Command command = TestProcessor.helpParse(sql);  
        ProcessorPlan plan = TestProcessor.helpGetPlan(command, fakeMetadata, capFinder);
       
        //Verify a dependent join (not merge join) was used
        assertTrue(plan instanceof RelationalPlan);
        RelationalPlan relationalPlan = (RelationalPlan)plan;
View Full Code Here


        List[] expected = new List[] {
            Arrays.asList(new Object[] {
                new String("b")})}; //$NON-NLS-1$

        Command command = TestProcessor.helpParse(sql);
        ProcessorPlan plan = TestProcessor.helpGetPlan(command, fakeMetadata, capFinder);

        // Run query
        TestProcessor.helpProcess(plan, dataManager, expected);
    }
View Full Code Here

            Arrays.asList("a"), //$NON-NLS-1$
            Arrays.asList("a"), //$NON-NLS-1$
            Arrays.asList("b"), //$NON-NLS-1$
          };

        Command command = TestProcessor.helpParse(sql);
        ProcessorPlan plan = TestProcessor.helpGetPlan(command, fakeMetadata, capFinder);
        TestOptimizer.checkAtomicQueries(new String[] {
            "SELECT pm1.g2.e4 FROM pm1.g2",
            "SELECT pm2.g1.e1, pm2.g1.e2, pm2.g1.e4 FROM pm2.g1 WHERE (pm2.g1.e1 IN (<dependent values>)) AND (pm2.g1.e2 IN (<dependent values>)) AND (pm2.g1.e4 IN (<dependent values>))",
            "SELECT pm1.g1.e1, pm1.g1.e2 FROM pm1.g1"
View Full Code Here

        capFinder.addCapabilities("pm4", depcaps); //$NON-NLS-1$
        capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$

        FakeMetadataFacade fakeMetadata = FakeMetadataFactory.example1Cached();

        Command command = TestProcessor.helpParse(sql);
        ProcessorPlan plan = TestProcessor.helpGetPlan(command, fakeMetadata, capFinder);

        //Verify a dependent join (not merge join) was used
        assertTrue(plan instanceof RelationalPlan);
        RelationalPlan relationalPlan = (RelationalPlan)plan;
View Full Code Here

       caps.setCapabilitySupport(Capability.CRITERIA_IN, true);
       caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1000));
       capFinder.addCapabilities("pm1", caps); //$NON-NLS-1$
       capFinder.addCapabilities("pm2", caps); //$NON-NLS-1$
      
       Command command = TestProcessor.helpParse(sql);  
       ProcessorPlan plan = TestProcessor.helpGetPlan(command, FakeMetadataFactory.example1Cached(), capFinder);

       // Run query
       TestProcessor.helpProcess(plan, dataManager, expected);
   }   
View Full Code Here

            AccessNode instanceNode = (AccessNode) accessNode.clone();
            instanceNode.setID(getID());
            instanceNode.setConnectorBindingId(sourceName);
           
            // Modify the command to pull the instance column and evaluate the criteria
            Command command = (Command)instanceNode.getCommand().clone();
           
            command = rewriteCommand(sourceName, command);
           
            if (command == null) {
              continue;
View Full Code Here

    }
   
    //====Help methods====//
    private void helpPutPreparedPlans(SessionAwareCache<PreparedPlan> cache, DQPWorkContext session, int start, int count){
      for(int i=0; i<count; i++){
        Command dummy;
      try {
        dummy = QueryParser.getQueryParser().parseCommand(EXAMPLE_QUERY + (start + i));
      } catch (QueryParserException e) {
        throw new RuntimeException(e);
      }
        CacheID id = new CacheID(session, pi, dummy.toString());

        PreparedPlan pPlan = new PreparedPlan();
        cache.put(id, Determinism.SESSION_DETERMINISTIC, pPlan, null);
        pPlan.setCommand(dummy);
        pPlan.setPlan(new RelationalPlan(new ProjectNode(i)), new CommandContext());
View Full Code Here

     */
    public void testValidateEntitlement() throws Exception {
        QueryMetadataInterface metadata = FakeMetadataFactory.example1Cached();
       
        Request request = new Request();
        Command command = QueryParser.getQueryParser().parseCommand(QUERY);
        QueryResolver.resolveCommand(command, metadata);
       
        RequestMessage message = new RequestMessage();
        DQPWorkContext workContext = FakeMetadataFactory.buildWorkContext(metadata, FakeMetadataFactory.example1VDB());
       
View Full Code Here

        super(name);
    }

    public static Call example() throws Exception {
        String sql = "EXEC pm1.sq3('x', 1)"; //$NON-NLS-1$
        Command command = new QueryParser().parseCommand(sql);
        QueryResolver.resolveCommand(command, TstLanguageBridgeFactory.metadata);               
        return TstLanguageBridgeFactory.factory.translate((StoredProcedure)command);
    }
View Full Code Here

        return svc;
    }

    private void helpTest(DataPolicyMetadata policy, String sql, QueryMetadataInterface metadata, String[] expectedInaccesible, VDBMetaData vdb) throws QueryParserException, QueryResolverException, TeiidComponentException {
        QueryParser parser = QueryParser.getQueryParser();
        Command command = parser.parseCommand(sql);
        QueryResolver.resolveCommand(command, metadata);
       
        vdb.addAttchment(QueryMetadataInterface.class, metadata);
       
        HashMap<String, DataPolicy> policies = new HashMap<String, DataPolicy>();
View Full Code Here

TOP

Related Classes of org.teiid.query.sql.lang.Command

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.