Search in sources :

Example 1 with TempMetadataAdapter

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

the class TestStoredProcedurePlanning method testStoredQuery19.

// GeminiStoredQueryTestPlan - 2c
@Ignore("stored procedure wrapper removal logic has been removed")
@Test
public void testStoredQuery19() {
    ProcessorPlan plan = // $NON-NLS-1$
    TestOptimizer.helpPlan(// $NON-NLS-1$
    "EXEC pm1.sq13('1')", // $NON-NLS-1$
    new TempMetadataAdapter(RealMetadataFactory.example1Cached(), new TempMetadataStore()), // $NON-NLS-1$
    new String[] { "INSERT INTO pm1.g1 (e1, e2) VALUES ('1', 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 2 with TempMetadataAdapter

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

the class TestStoredProcedurePlanning method testStoredQuery20.

// GeminiStoredQueryTestPlan - 3c
@Ignore("stored procedure wrapper removal logic has been removed")
@Test
public void testStoredQuery20() {
    ProcessorPlan plan = // $NON-NLS-1$
    TestOptimizer.helpPlan(// $NON-NLS-1$
    "EXEC pm1.sq14('1', 2)", // $NON-NLS-1$
    new TempMetadataAdapter(RealMetadataFactory.example1Cached(), new TempMetadataStore()), // $NON-NLS-1$
    new String[] { "UPDATE pm1.g1 SET e1 = '1' WHERE 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 3 with TempMetadataAdapter

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

the class TestStoredProcedurePlanning method testStoredQuery11.

/**
 * Test planning stored queries. GeminiStoredQueryTestPlan - 5c
 */
@Ignore("stored procedure wrapper removal logic has been removed")
@Test
public void testStoredQuery11() {
    ProcessorPlan plan = // $NON-NLS-1$
    TestOptimizer.helpPlan(// $NON-NLS-1$
    "EXEC pm1.sq6()", // $NON-NLS-1$
    new TempMetadataAdapter(RealMetadataFactory.example1Cached(), new TempMetadataStore()), // $NON-NLS-1$
    new String[] { "SELECT e1, e2 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 4 with TempMetadataAdapter

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

the class TestStoredProcedurePlanning method testStoredQuery23.

@Ignore("stored procedure wrapper removal logic has been removed")
@Test
public void testStoredQuery23() {
    ProcessorPlan plan = // $NON-NLS-1$
    TestOptimizer.helpPlan(// $NON-NLS-1$
    "EXEC pm1.sq16()", // $NON-NLS-1$
    new TempMetadataAdapter(RealMetadataFactory.example1Cached(), new TempMetadataStore()), // $NON-NLS-1$
    new String[] { "INSERT INTO pm1.g1 (e1, e2) VALUES ('1', 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 5 with TempMetadataAdapter

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

the class TestStoredProcedurePlanning method testStoredProc1.

/**
 * union of two stored procs - case #1466
 */
@Test
public void testStoredProc1() {
    ProcessorPlan plan = // $NON-NLS-1$
    TestOptimizer.helpPlan(// $NON-NLS-1$
    "SELECT * FROM (EXEC pm1.sp2(1)) AS x UNION ALL SELECT * FROM (EXEC pm1.sp2(2)) AS y", // $NON-NLS-1$
    new TempMetadataAdapter(RealMetadataFactory.example1Cached(), new TempMetadataStore()), // $NON-NLS-1$ //$NON-NLS-2$
    new String[] { "EXEC pm1.sp2(1)", "EXEC pm1.sp2(2)" });
    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
    4, // 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

TempMetadataAdapter (org.teiid.query.metadata.TempMetadataAdapter)53 TempMetadataStore (org.teiid.query.metadata.TempMetadataStore)45 Test (org.junit.Test)32 ProcessorPlan (org.teiid.query.processor.ProcessorPlan)32 Ignore (org.junit.Ignore)21 QueryMetadataInterface (org.teiid.query.metadata.QueryMetadataInterface)9 CommandContext (org.teiid.query.util.CommandContext)6 List (java.util.List)4 QueryResolverException (org.teiid.api.exception.query.QueryResolverException)4 TempMetadataID (org.teiid.query.metadata.TempMetadataID)4 Command (org.teiid.query.sql.lang.Command)4 GroupSymbol (org.teiid.query.sql.symbol.GroupSymbol)4 TeiidComponentException (org.teiid.core.TeiidComponentException)3 TeiidProcessingException (org.teiid.core.TeiidProcessingException)3 AnalysisRecord (org.teiid.query.analysis.AnalysisRecord)3 TempCapabilitiesFinder (org.teiid.query.metadata.TempCapabilitiesFinder)3 TransformationMetadata (org.teiid.query.metadata.TransformationMetadata)3 GroupContext (org.teiid.query.sql.lang.GroupContext)3 TempTableStore (org.teiid.query.tempdata.TempTableStore)3 ArrayList (java.util.ArrayList)2