Package org.teiid.query.optimizer.capabilities

Examples of org.teiid.query.optimizer.capabilities.DefaultCapabilitiesFinder


        assertNotNull("Expected exception but did not get one.", exception); //$NON-NLS-1$
        return null;
    }
   
    public static CapabilitiesFinder getGenericFinder() {
        return new DefaultCapabilitiesFinder(new FakeCapabilities(true));
    }
View Full Code Here


   
    @Test public void testProjectionRaisingWithLimit() {
        // Create query
        String sql = "select e1, (select e1 from pm2.g1 where e2 = x.e2) from pm1.g1 as x order by e1 limit 2"; //$NON-NLS-1$

        RelationalPlan plan = (RelationalPlan)helpPlan(sql, FakeMetadataFactory.example1Cached(), null, new DefaultCapabilitiesFinder(),
                                      new String[] {"SELECT pm1.g1.e1, pm1.g1.e2 FROM pm1.g1"}, TestOptimizer.SHOULD_SUCCEED); //$NON-NLS-1$
       
        assertTrue(plan.getRootNode() instanceof ProjectNode);
    }
View Full Code Here

   
    @Test public void testProjectionRaisingWithLimit1() {
        // Create query
        String sql = "select (select e1 from pm2.g1 where e2 = x.e2) as z from pm1.g1 as x order by z limit 2"; //$NON-NLS-1$

        RelationalPlan plan = (RelationalPlan)helpPlan(sql, FakeMetadataFactory.example1Cached(), null, new DefaultCapabilitiesFinder(),
                                      new String[] {"SELECT pm1.g1.e2 FROM pm1.g1"}, TestOptimizer.SHOULD_SUCCEED); //$NON-NLS-1$
       
        assertTrue(plan.getRootNode() instanceof LimitNode);
    }
View Full Code Here

    FakeDataManager dm = new FakeDataManager();
    FakeDataStore.addTable("pm1.g1", dm, metadata);
   
    CommandContext context = createCommandContext();
        BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
        ProcessorPlan plan = TestProcessor.helpGetPlan(TestResolver.helpResolve(sql, metadata), metadata, new DefaultCapabilitiesFinder(caps), context);
        List[] expected = new List[] {Arrays.asList(1)};
      helpProcess(plan, context, dm, expected);
  }
View Full Code Here

   
    FakeDataManager dm = new FakeDataManager();
    FakeDataStore.addTable("pm1.g1", dm, metadata);
    CommandContext context = createCommandContext();
        BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
        ProcessorPlan plan = TestProcessor.helpGetPlan(TestResolver.helpResolve(sql, metadata), metadata, new DefaultCapabilitiesFinder(caps), context);
        List[] expected = new List[] {Arrays.asList(6)};
      helpProcess(plan, context, dm, expected);
  }
View Full Code Here

    FakeDataManager dm = new FakeDataManager();
    FakeDataStore.addTable("pm1.g1", dm, metadata);
   
    CommandContext context = createCommandContext();
        BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
        ProcessorPlan plan = TestProcessor.helpGetPlan(TestResolver.helpResolve(sql, metadata), metadata, new DefaultCapabilitiesFinder(caps), context);
        List[] expected = new List[] {Arrays.asList(1)};
      helpProcess(plan, context, dm, expected);
  }
View Full Code Here

    FakeDataManager dm = new FakeDataManager();
    FakeDataStore.addTable("pm1.g1", dm, metadata);
   
    CommandContext context = createCommandContext();
        BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
        ProcessorPlan plan = TestProcessor.helpGetPlan(TestResolver.helpResolve(sql, metadata), metadata, new DefaultCapabilitiesFinder(caps), context);
        List[] expected = new List[] {Arrays.asList(1)};
      helpProcess(plan, context, dm, expected);
      assertEquals("UPDATE pm1.g1 SET e2 = 5 WHERE e2 = 2", dm.getQueries().get(0));
  }
View Full Code Here

    FakeDataManager dm = new FakeDataManager();
    FakeDataStore.addTable("pm1.g1", dm, metadata);
   
    CommandContext context = createCommandContext();
        BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
        ProcessorPlan plan = TestProcessor.helpGetPlan(TestResolver.helpResolve(sql, metadata), metadata, new DefaultCapabilitiesFinder(caps), context);
        List[] expected = new List[] {Arrays.asList(1)};
      helpProcess(plan, context, dm, expected);
      assertEquals("UPDATE pm1.g1 SET e2 = 1 WHERE e2 = 2", dm.getQueries().get(0));
  }
View Full Code Here

        if (dm != null) {
          CommandContext context = createCommandContext();
          BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
          caps.setFunctionSupport(SourceSystemFunctions.CONVERT, true);
          ProcessorPlan plan = helpGetPlan(command, metadata, new DefaultCapabilitiesFinder(caps), context);
          List[] expected = new List[] {Arrays.asList(1)};
          helpProcess(plan, context, dm, expected);
        }
       
        return command;
View Full Code Here

   
    @Test public void testMergeImplicitGroupBy() throws Exception {
      BasicSourceCapabilities caps = TestAggregatePushdown.getAggregateCapabilities();
      caps.setFunctionSupport("+", true); //$NON-NLS-1$
        ProcessorPlan plan = TestOptimizer.helpPlan("SELECT x FROM (SELECT min(y), max(x) as x FROM (select e1 x, e2 + 1 y from pm1.g1) a) AS b", //$NON-NLS-1$
                                      FakeMetadataFactory.example1Cached(), null, new DefaultCapabilitiesFinder(caps),
                                      new String[] {
                                          "SELECT MAX(g_0.e1) FROM pm1.g1 AS g_0"}, ComparisonMode.EXACT_COMMAND_STRING); //$NON-NLS-1$
   
        TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);                                   
    }
View Full Code Here

TOP

Related Classes of org.teiid.query.optimizer.capabilities.DefaultCapabilitiesFinder

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.