Search in sources :

Example 41 with TempMetadataStore

use of org.teiid.query.metadata.TempMetadataStore in project teiid by teiid.

the class TestStoredProcedurePlanning method testStoredQuery21.

// GeminiStoredQueryTestPlan - 4b
@Ignore("stored procedure wrapper removal logic has been removed")
@Test
public void testStoredQuery21() {
    ProcessorPlan plan = // $NON-NLS-1$
    TestOptimizer.helpPlan(// $NON-NLS-1$
    "EXEC pm1.sq15('1', 2)", // $NON-NLS-1$
    new TempMetadataAdapter(RealMetadataFactory.example1Cached(), new TempMetadataStore()), // $NON-NLS-1$
    new String[] { "DELETE FROM pm1.g1 WHERE (e1 = '1') AND (e2 = 2)" });
    TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
}
Also used : TempMetadataAdapter(org.teiid.query.metadata.TempMetadataAdapter) ProcessorPlan(org.teiid.query.processor.ProcessorPlan) TempMetadataStore(org.teiid.query.metadata.TempMetadataStore) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 42 with TempMetadataStore

use of org.teiid.query.metadata.TempMetadataStore in project teiid by teiid.

the class TestStoredProcedurePlanning method testStoredQuery5.

@Test
public void testStoredQuery5() {
    ProcessorPlan plan = // $NON-NLS-1$
    TestOptimizer.helpPlan(// $NON-NLS-1$
    "EXEC pm1.sp1()", // $NON-NLS-1$
    new TempMetadataAdapter(RealMetadataFactory.example1Cached(), new TempMetadataStore()), // $NON-NLS-1$
    new String[] { "EXEC pm1.sp1()" });
    TestOptimizer.checkNodeTypes(plan, new int[] { // Access
    1, // DependentAccess
    0, // DependentSelect
    0, // DependentProject
    0, // DupRemove
    0, // Grouping
    0, // NestedLoopJoinStrategy
    0, // MergeJoinStrategy
    0, // Null
    0, // PlanExecution
    0, // Project
    1, // Select
    0, // Sort
    0, // UnionAll
    0 });
}
Also used : TempMetadataAdapter(org.teiid.query.metadata.TempMetadataAdapter) ProcessorPlan(org.teiid.query.processor.ProcessorPlan) TempMetadataStore(org.teiid.query.metadata.TempMetadataStore) Test(org.junit.Test)

Example 43 with TempMetadataStore

use of org.teiid.query.metadata.TempMetadataStore in project teiid by teiid.

the class TestStoredProcedurePlanning method testStoredQuery2.

/**
 * Test planning stored queries
 */
@Ignore("stored procedure wrapper removal logic has been removed")
@Test
public void testStoredQuery2() {
    ProcessorPlan plan = // $NON-NLS-1$
    TestOptimizer.helpPlan(// $NON-NLS-1$
    "EXEC pm1.sq1()", // $NON-NLS-1$
    new TempMetadataAdapter(RealMetadataFactory.example1Cached(), new TempMetadataStore()), // $NON-NLS-1$
    new String[] { "SELECT e1, e2 FROM pm1.g1" });
    TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
}
Also used : TempMetadataAdapter(org.teiid.query.metadata.TempMetadataAdapter) ProcessorPlan(org.teiid.query.processor.ProcessorPlan) TempMetadataStore(org.teiid.query.metadata.TempMetadataStore) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 44 with TempMetadataStore

use of org.teiid.query.metadata.TempMetadataStore in project teiid by teiid.

the class TestStoredProcedurePlanning method testStoredQuery14.

/**
 * Test planning stored queries. GeminiStoredQueryTestPlan - 6b
 */
@Ignore("stored procedure wrapper removal logic has been removed")
@Test
public void testStoredQuery14() {
    ProcessorPlan plan = // $NON-NLS-1$
    TestOptimizer.helpPlan(// $NON-NLS-1$
    "EXEC pm1.sq9('1')", // $NON-NLS-1$
    new TempMetadataAdapter(RealMetadataFactory.example1Cached(), new TempMetadataStore()), // $NON-NLS-1$
    new String[] { "SELECT e1 FROM pm1.g1 WHERE e1 = '1'" });
    TestOptimizer.checkNodeTypes(plan, TestOptimizer.FULL_PUSHDOWN);
}
Also used : TempMetadataAdapter(org.teiid.query.metadata.TempMetadataAdapter) ProcessorPlan(org.teiid.query.processor.ProcessorPlan) TempMetadataStore(org.teiid.query.metadata.TempMetadataStore) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 45 with TempMetadataStore

use of org.teiid.query.metadata.TempMetadataStore in project teiid by teiid.

the class TestStoredProcedurePlanning method testStoredProc2.

/**
 * union of stored proc and query - case #1466
 */
@Test
public void testStoredProc2() {
    ProcessorPlan plan = // $NON-NLS-1$
    TestOptimizer.helpPlan(// $NON-NLS-1$
    "SELECT * FROM (EXEC pm1.sp2(1)) AS x UNION ALL SELECT e1, e2 FROM pm1.g1", // $NON-NLS-1$
    new TempMetadataAdapter(RealMetadataFactory.example1Cached(), new TempMetadataStore()), // $NON-NLS-1$ //$NON-NLS-2$
    new String[] { "EXEC pm1.sp2(1)", "SELECT e1, e2 FROM pm1.g1" });
    TestOptimizer.checkNodeTypes(plan, new int[] { // Access
    2, // DependentAccess
    0, // DependentSelect
    0, // DependentProject
    0, // DupRemove
    0, // Grouping
    0, // NestedLoopJoinStrategy
    0, // MergeJoinStrategy
    0, // Null
    0, // PlanExecution
    0, // Project
    2, // Select
    0, // Sort
    0, // UnionAll
    1 });
}
Also used : TempMetadataAdapter(org.teiid.query.metadata.TempMetadataAdapter) ProcessorPlan(org.teiid.query.processor.ProcessorPlan) TempMetadataStore(org.teiid.query.metadata.TempMetadataStore) Test(org.junit.Test)

Aggregations

TempMetadataStore (org.teiid.query.metadata.TempMetadataStore)52 TempMetadataAdapter (org.teiid.query.metadata.TempMetadataAdapter)45 Test (org.junit.Test)33 ProcessorPlan (org.teiid.query.processor.ProcessorPlan)32 Ignore (org.junit.Ignore)21 TempMetadataID (org.teiid.query.metadata.TempMetadataID)6 CommandContext (org.teiid.query.util.CommandContext)6 List (java.util.List)5 QueryResolverException (org.teiid.api.exception.query.QueryResolverException)5 QueryMetadataInterface (org.teiid.query.metadata.QueryMetadataInterface)5 Command (org.teiid.query.sql.lang.Command)5 GroupContext (org.teiid.query.sql.lang.GroupContext)5 Expression (org.teiid.query.sql.symbol.Expression)5 GroupSymbol (org.teiid.query.sql.symbol.GroupSymbol)5 ElementSymbol (org.teiid.query.sql.symbol.ElementSymbol)4 ArrayList (java.util.ArrayList)3 TeiidProcessingException (org.teiid.core.TeiidProcessingException)3 AnalysisRecord (org.teiid.query.analysis.AnalysisRecord)3 CreateProcedureCommand (org.teiid.query.sql.proc.CreateProcedureCommand)3 LinkedList (java.util.LinkedList)2