Package org.teiid.dqp.internal.datamgr

Examples of org.teiid.dqp.internal.datamgr.LanguageBridgeFactory


      this(true);
    }
   
    public HardcodedDataManager(QueryMetadataInterface metadata) {
      this(true);
      this.lbf = new LanguageBridgeFactory(metadata);
    }
View Full Code Here


    // this has two result set columns and 1 out parameter
    int total_columns = 3;
    StoredProcedure command = (StoredProcedure)helpGetCommand("{call pm2.spTest8(?)}", EXAMPLE_BQT); //$NON-NLS-1$     
    command.getInputParameters().get(0).setExpression(new Constant(1));
    Call proc = (Call)new LanguageBridgeFactory(EXAMPLE_BQT).translate(command);

    ProcedureBatchHandler pbh = new ProcedureBatchHandler(proc, exec);

    assertEquals(total_columns, pbh.padRow(Arrays.asList(null, null)).size());
View Full Code Here

   
    @Test public void testInlineViewOrderBy() throws Exception {
        String sql = "select intnum from (select intnum from bqt1.smallb) b order by b.intnum"; //$NON-NLS-1$
        String expected = "SELECT v_0.c_0 FROM (SELECT g_0.intnum AS c_0 FROM bqt1.smallb AS g_0) AS v_0 ORDER BY c_0"; //$NON-NLS-1$
        Command command = helpTest(sql, expected, true, false, FakeMetadataFactory.exampleBQTCached());
        LanguageBridgeFactory lbf = new LanguageBridgeFactory(FakeMetadataFactory.exampleBQTCached());
        org.teiid.language.Command c = lbf.translate(command);
        assertEquals("SELECT v_0.c_0 FROM (SELECT g_0.IntNum AS c_0 FROM SmallB AS g_0) AS v_0 ORDER BY v_0.c_0", c.toString());
    }
View Full Code Here

   
    @Test public void testStripAliases1() throws Exception {
      String sql = "select intkey as a, stringkey as b from BQT1.SmallA ORDER BY a, b"; //$NON-NLS-1$
        String expected = "SELECT BQT1.SmallA.intkey, BQT1.SmallA.stringkey FROM BQT1.SmallA ORDER BY BQT1.SmallA.intkey, BQT1.SmallA.stringkey"; //$NON-NLS-1$
        Command command = helpTest(sql, expected, false, true, FakeMetadataFactory.exampleBQTCached());
        LanguageBridgeFactory lbf = new LanguageBridgeFactory(FakeMetadataFactory.exampleBQTCached());
        org.teiid.language.Command c = lbf.translate(command);
        assertEquals("SELECT SmallA.IntKey, SmallA.StringKey FROM SmallA ORDER BY SmallA.IntKey, SmallA.StringKey", c.toString());
    }
View Full Code Here

            command = QueryRewriter.rewrite(command, metadata, null);
            expandAllSymbol(command);           
            if (generateAliases) {
                command.acceptVisitor(new AliasGenerator(supportsGroupAlias));
            }
            return new LanguageBridgeFactory(metadata).translate(command);
        } catch (TeiidException e) {
            throw new TeiidRuntimeException(e);
    }
    }
View Full Code Here

TOP

Related Classes of org.teiid.dqp.internal.datamgr.LanguageBridgeFactory

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.