use of org.teiid.translator.jdbc.SQLConversionVisitor in project teiid by teiid.
the class TestSubstringFunctionModifier method helpTestMod.
public void helpTestMod(Expression[] args, String expectedStr) throws Exception {
Function func = LANG_FACTORY.createFunction("substring", Arrays.asList(args), TypeFacility.RUNTIME_TYPES.STRING);
NetezzaExecutionFactory trans = new NetezzaExecutionFactory();
trans.start();
SQLConversionVisitor sqlVisitor = trans.getSQLConversionVisitor();
sqlVisitor.append(func);
assertEquals(expectedStr, sqlVisitor.toString());
}
use of org.teiid.translator.jdbc.SQLConversionVisitor in project teiid by teiid.
the class TestIngresConvertModifier method helpGetString.
public String helpGetString(Expression expr) throws Exception {
IngresExecutionFactory trans = new IngresExecutionFactory();
trans.start();
SQLConversionVisitor sqlVisitor = trans.getSQLConversionVisitor();
sqlVisitor.append(expr);
return sqlVisitor.toString();
}
use of org.teiid.translator.jdbc.SQLConversionVisitor in project teiid by teiid.
the class TestInterSystemsCacheTranslation method helpGetString.
public String helpGetString(Expression expr) throws Exception {
SQLConversionVisitor sqlVisitor = TRANSLATOR.getSQLConversionVisitor();
sqlVisitor.append(expr);
return sqlVisitor.toString();
}
use of org.teiid.translator.jdbc.SQLConversionVisitor in project teiid by teiid.
the class TestTeradataTranslator method helpGetString.
public String helpGetString(Expression expr) throws Exception {
SQLConversionVisitor sqlVisitor = TRANSLATOR.getSQLConversionVisitor();
sqlVisitor.append(expr);
return sqlVisitor.toString();
}
use of org.teiid.translator.jdbc.SQLConversionVisitor in project teiid by teiid.
the class TestHiveExecutionFactory method helpTest.
private void helpTest(Expression srcExpression, String tgtType, String expectedExpression) throws Exception {
Function func = LANG_FACTORY.createFunction("convert", Arrays.asList(srcExpression, LANG_FACTORY.createLiteral(tgtType, String.class)), TypeFacility.getDataTypeClass(tgtType));
SQLConversionVisitor sqlVisitor = hiveTranslator.getSQLConversionVisitor();
sqlVisitor.append(func);
assertEquals("Error converting from " + srcExpression.getType() + " to " + tgtType, expectedExpression, sqlVisitor.toString());
}
Aggregations