Search in sources :

Example 31 with SQLConversionVisitor

use of org.teiid.translator.jdbc.SQLConversionVisitor in project teiid by teiid.

the class TestImpalaExecutionFactory method testPredicateFunctions.

@Test
public void testPredicateFunctions() {
    Select obj = (Select) TranslationHelper.helpTranslate("/bqt.vdb", null, impalaTranslator.getPushDownFunctions(), "select stringnum FROM bqt1.SmallA where ilike(stringkey, 'a_') and not(ilike(stringkey, '_b'))");
    SQLConversionVisitor sqlVisitor = impalaTranslator.getSQLConversionVisitor();
    sqlVisitor.append(obj);
    assertEquals("SELECT SmallA.StringNum FROM SmallA WHERE (SmallA.StringKey ilike 'a_') AND NOT((SmallA.StringKey ilike '_b'))", sqlVisitor.toString());
}
Also used : SQLConversionVisitor(org.teiid.translator.jdbc.SQLConversionVisitor) Select(org.teiid.language.Select) Test(org.junit.Test)

Aggregations

SQLConversionVisitor (org.teiid.translator.jdbc.SQLConversionVisitor)31 Test (org.junit.Test)10 CommandBuilder (org.teiid.cdk.CommandBuilder)9 Command (org.teiid.language.Command)9 Function (org.teiid.language.Function)9 Select (org.teiid.language.Select)3 TranslatedCommand (org.teiid.translator.jdbc.TranslatedCommand)1 PhoenixExecutionFactory (org.teiid.translator.phoenix.PhoenixExecutionFactory)1