Search in sources :

Example 46 with TempMetadataAdapter

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

the class TestStoredProcedurePlanning method testStoredQuery8.

/**
 * Test planning stored queries. GeminiStoredQueryTestPlan - 1c
 */
@Ignore("stored procedure wrapper removal logic has been removed")
@Test
public void testStoredQuery8() {
    ProcessorPlan plan = // $NON-NLS-1$
    TestOptimizer.helpPlan(// $NON-NLS-1$
    "EXEC pm1.sq3('1', 1)", // $NON-NLS-1$
    new TempMetadataAdapter(RealMetadataFactory.example1Cached(), new TempMetadataStore()), // $NON-NLS-1$ //$NON-NLS-2$
    new String[] { "SELECT e1, e2 FROM pm1.g1 WHERE e1 = '1'", "SELECT e1, e2 FROM pm1.g1 WHERE e2 = 1" });
    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
    0, // 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) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 47 with TempMetadataAdapter

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

the class TestStoredProcedurePlanning method testStoredQuery18.

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

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

the class TestStoredProcedurePlanning method testStoredQuery7.

@Ignore("stored procedure wrapper removal logic has been removed")
@Test
public void testStoredQuery7() {
    ProcessorPlan plan = // $NON-NLS-1$
    TestOptimizer.helpPlan(// $NON-NLS-1$
    "EXEC pm1.sqsp1()", // $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
    2, // 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) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 49 with TempMetadataAdapter

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

the class TestMaterialization method setUp.

@Before
public void setUp() {
    // $NON-NLS-1$
    tempStore = new TempTableStore("1", TransactionMode.ISOLATE_WRITES);
    BufferManager bm = BufferManagerFactory.getStandaloneBufferManager();
    TransformationMetadata actualMetadata = RealMetadataFactory.exampleMaterializedView();
    globalStore = new GlobalTableStoreImpl(bm, actualMetadata.getVdbMetaData(), actualMetadata);
    metadata = new TempMetadataAdapter(actualMetadata, tempStore.getMetadataStore());
    hdm = new HardcodedDataManager();
    hdm.addData("SELECT MatSrc.MatSrc.x FROM MatSrc.MatSrc", new List[] { Arrays.asList((String) null), Arrays.asList("one"), Arrays.asList("two"), Arrays.asList("three") });
    hdm.addData("SELECT MatTable.info.e1, MatTable.info.e2 FROM MatTable.info", new List[] { Arrays.asList("a", 1), Arrays.asList("a", 2) });
    hdm.addData("SELECT MatTable.info.e2, MatTable.info.e1 FROM MatTable.info", new List[] { Arrays.asList(1, "a"), Arrays.asList(2, "a") });
    SessionAwareCache<CachedResults> cache = new SessionAwareCache<CachedResults>("resultset", DefaultCacheFactory.INSTANCE, SessionAwareCache.Type.RESULTSET, 0);
    cache.setTupleBufferCache(bm);
    dataManager = new TempTableDataManager(hdm, bm, cache);
}
Also used : TempMetadataAdapter(org.teiid.query.metadata.TempMetadataAdapter) TempTableStore(org.teiid.query.tempdata.TempTableStore) TransformationMetadata(org.teiid.query.metadata.TransformationMetadata) SessionAwareCache(org.teiid.dqp.internal.process.SessionAwareCache) TempTableDataManager(org.teiid.query.tempdata.TempTableDataManager) BufferManager(org.teiid.common.buffer.BufferManager) GlobalTableStoreImpl(org.teiid.query.tempdata.GlobalTableStoreImpl) CachedResults(org.teiid.dqp.internal.process.CachedResults) Before(org.junit.Before)

Example 50 with TempMetadataAdapter

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

the class TempTableTestHarness method setUp.

public void setUp(QueryMetadataInterface qmi, ProcessorDataManager dm, BufferManager bm) {
    // $NON-NLS-1$
    tempStore = new TempTableStore("1", TransactionMode.ISOLATE_WRITES);
    metadata = new TempMetadataAdapter(qmi, tempStore.getMetadataStore());
    metadata.setSession(true);
    SessionAwareCache<CachedResults> cache = new SessionAwareCache<CachedResults>("resultset", DefaultCacheFactory.INSTANCE, SessionAwareCache.Type.RESULTSET, 0);
    cache.setTupleBufferCache(bm);
    dataManager = new TempTableDataManager(dm, bm, cache);
}
Also used : TempMetadataAdapter(org.teiid.query.metadata.TempMetadataAdapter) TempTableStore(org.teiid.query.tempdata.TempTableStore) SessionAwareCache(org.teiid.dqp.internal.process.SessionAwareCache) TempTableDataManager(org.teiid.query.tempdata.TempTableDataManager) CachedResults(org.teiid.dqp.internal.process.CachedResults)

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