Package org.teiid.query.metadata

Examples of org.teiid.query.metadata.QueryMetadataInterface


     */
    public void testRootStagingTableCase4308() throws Exception{
       
        String sql = "select * from vm1.doc1 where stagingTable2.e1 IN ('a', 'b', 'c')"; //$NON-NLS-1$
       
        QueryMetadataInterface metadata = exampleCase4308();
       
        Query query = (Query)new QueryParser().parseCommand(sql);
        QueryResolver.resolveCommand(query, metadata);
       
        String expectedStagingTableResultSet = "tm1.stagingTable2"; //$NON-NLS-1$
View Full Code Here


  private ProcessorPlan helpPlanProcedure(String userQuery,
                                            String procedure,
                                            String procedureType) throws TeiidComponentException,
                                                                 QueryMetadataException, TeiidProcessingException {
        QueryMetadataInterface metadata = FakeMetadataFactory.exampleUpdateProc(procedureType, procedure);

        QueryParser parser = QueryParser.getQueryParser();
        Command userCommand = userQuery != null ? parser.parseCommand(userQuery) : parser.parseCommand(procedure);
       
        if (userCommand instanceof CreateUpdateProcedureCommand) {
View Full Code Here

        caps.setSourceProperty(Capability.MAX_IN_CRITERIA_SIZE, new Integer(1000));
        caps.setFunctionSupport("||", true); //$NON-NLS-1$
        capFinder.addCapabilities("BQT1", caps); //$NON-NLS-1$
        capFinder.addCapabilities("BQT2", caps); //$NON-NLS-1$

        QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQT();
        FakeMetadataFactory.setCardinality("bqt1.smalla", RuleChooseDependent.DEFAULT_INDEPENDENT_CARDINALITY + 1000, metadata); //$NON-NLS-1$
        FakeMetadataFactory.setCardinality("bqt2.smalla", RuleChooseDependent.DEFAULT_INDEPENDENT_CARDINALITY - 1, metadata); //$NON-NLS-1$
        
        ProcessorPlan plan = TestOptimizer.helpPlan(
            "SELECT table1comp.IntKey, table1comp.key1, BQT1.SmallA.StringKey FROM (SELECT t1.*, (STRINGKEY || STRINGNUM) AS key1 FROM BQT2.SmallA AS t1) AS table1comp, BQT1.SmallA WHERE table1comp.key1 = BQT1.SmallA.StringKey"//$NON-NLS-1$
View Full Code Here

    @Test public void testCase3845() throws Exception {
       
        String input = "SELECT (DoubleNum * 1.0) FROM BQT1.Smalla"; //$NON-NLS-1$
        String output = "SELECT (SmallishA.DoubleNum * 1.0) FROM SmallishA"; //$NON-NLS-1$

        QueryMetadataInterface metadata = getOracleSpecificMetadata();

        helpTestVisitor(metadata, input, EMPTY_CONTEXT, null, output);
    }
View Full Code Here

       
        Column obj = cols.get(0);
        obj.setNativeType("uniqueidentifier"); //$NON-NLS-1$
       
        CompositeMetadataStore store = new CompositeMetadataStore(metadataStore);
        QueryMetadataInterface metadata = new TransformationMetadata(null, store, null, FakeMetadataFactory.SFM.getSystemFunctions(), null);
       
        TranslationUtility tu = new TranslationUtility(metadata);
        Command command = tu.parseCommand("select max(x) from bar"); //$NON-NLS-1$
        TranslationHelper.helpTestVisitor("SELECT MAX(cast(bar.x as char(36))) FROM bar", trans, command); //$NON-NLS-1$
       
View Full Code Here

        helpTestProcess(plan, expected, dataMgr, metadata);
    }
   
    @Test public void testUnambiguousVirtualProc() throws Exception {
        String userQuery = "EXEC MMSP6('1')"; //$NON-NLS-1$
        QueryMetadataInterface metadata = FakeMetadataFactory.exampleBQTCached();
        ProcessorPlan plan = getProcedurePlan(userQuery, metadata, TestOptimizer.getGenericFinder());

        List[] expected = new List[] {
                Arrays.asList( "1" ),
        };
View Full Code Here

            Arrays.asList("a"),
        };   
   
    List values = Arrays.asList("a"); //$NON-NLS-1$
   
    QueryMetadataInterface metadata = FakeMetadataFactory.example1Cached();
        HardcodedDataManager dataManager = new HardcodedDataManager(metadata);
        dataManager.addData("SELECT g_0.e1 FROM g1 AS g_0 WHERE g_0.e2 IN (SELECT g_1.e2 FROM g2 AS g_1 WHERE g_1.e1 = 'a')", new List[] {Arrays.asList("a")});
        BasicSourceCapabilities caps = TestOptimizer.getTypicalCapabilities();
        caps.setCapabilitySupport(Capability.QUERY_SUBQUERIES_CORRELATED, true);
      caps.setCapabilitySupport(Capability.CRITERIA_IN_SUBQUERY, true);
View Full Code Here

        assertEquals(new Integer(expectedPrecision), md[column].get(ResultsMetadataConstants.PRECISION));
        assertEquals(new Integer(expectedScale), md[column].get(ResultsMetadataConstants.SCALE));
    }

    @Test public void testDefect16629_moneyType() throws Exception {
        QueryMetadataInterface metadata = FakeMetadataFactory.examplePrivatePhysicalModel();
        String sql = "SELECT e1 FROM pm1.g2"; //$NON-NLS-1$
       
        MetadataResult response = helpTestQuery(metadata, sql, FakeMetadataFactory.examplePrivatePhysicalModelVDB());
       
        helpCheckNumericAttributes(response, 0, 21, 19, 4);
View Full Code Here

       
        helpCheckNumericAttributes(response, 0, 21, 19, 4);
    }

    @Test public void testDefect16629_aggregatesOnMoneyType() throws Exception {
        QueryMetadataInterface metadata = FakeMetadataFactory.examplePrivatePhysicalModel();
        String sql = "SELECT min(e1), max(e1), sum(e1), avg(e1) FROM pm1.g2"; //$NON-NLS-1$
       
        MetadataResult response = helpTestQuery(metadata, sql, FakeMetadataFactory.examplePrivatePhysicalModelVDB());
        helpCheckNumericAttributes(response, 0, 21, 19, 4);
        helpCheckNumericAttributes(response, 1, 21, 19, 4);
View Full Code Here

               
        TestProcessor.helpProcess(plan, context, dataMgr, expectedResults);                       
    }

    @Test public void testNoReplacement() throws Exception {
        final QueryMetadataInterface metadata = FakeMetadataFactory.exampleMultiBinding();
        final String userSql = "SELECT * FROM MultiModel.Phys WHERE SOURCE_NAME = 'bogus'"; //$NON-NLS-1$
        final String multiModel = "MultiModel"; //$NON-NLS-1$
        final int sources = 2;
        final List[] expected =
            new List[0];
View Full Code Here

TOP

Related Classes of org.teiid.query.metadata.QueryMetadataInterface

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.