Search in sources :

Example 31 with Literal

use of org.teiid.language.Literal in project teiid by teiid.

the class TestDayWeekQuarterFunctionModifier method test2.

public void test2() throws Exception {
    Literal arg1 = LANG_FACTORY.createLiteral(TimestampUtil.createDate(104, 0, 21), java.sql.Date.class);
    helpTestMod(arg1, SourceSystemFunctions.DAYOFYEAR, // $NON-NLS-1$
    "to_number(TO_CHAR({d '2004-01-21'}, 'DDD'))");
}
Also used : Literal(org.teiid.language.Literal)

Example 32 with Literal

use of org.teiid.language.Literal in project teiid by teiid.

the class TestDayWeekQuarterFunctionModifier method test10.

public void test10() throws Exception {
    Literal arg1 = LANG_FACTORY.createLiteral(TimestampUtil.createDate(104, 0, 21), java.sql.Date.class);
    helpTestMod(arg1, SourceSystemFunctions.QUARTER, // $NON-NLS-1$
    "to_number(TO_CHAR({d '2004-01-21'}, 'Q'))");
}
Also used : Literal(org.teiid.language.Literal)

Example 33 with Literal

use of org.teiid.language.Literal in project teiid by teiid.

the class TestLeftOrRightFunctionModifier method test1.

public void test1() throws Exception {
    // $NON-NLS-1$
    Literal arg1 = LANG_FACTORY.createLiteral("1234214", String.class);
    Literal count = LANG_FACTORY.createLiteral(new Integer(11), Integer.class);
    helpTestMod(// $NON-NLS-1$
    arg1, // $NON-NLS-1$
    count, // $NON-NLS-1$
    "left", // $NON-NLS-1$
    "substr('1234214', 1, 11)");
}
Also used : Literal(org.teiid.language.Literal)

Example 34 with Literal

use of org.teiid.language.Literal in project teiid by teiid.

the class TestMonthOrDayNameFunctionModifier method test4.

public void test4() throws Exception {
    Literal arg1 = LANG_FACTORY.createLiteral(TimestampUtil.createDate(104, 0, 21), java.sql.Date.class);
    helpTestMod(// $NON-NLS-1$
    arg1, // $NON-NLS-1$
    "Day", // $NON-NLS-1$
    "rtrim(TO_CHAR({d '2004-01-21'}, 'Day'))");
}
Also used : Literal(org.teiid.language.Literal)

Example 35 with Literal

use of org.teiid.language.Literal in project teiid by teiid.

the class TestMonthOrDayNameFunctionModifier method test2.

public void test2() throws Exception {
    Literal arg1 = LANG_FACTORY.createLiteral(TimestampUtil.createDate(104, 0, 21), java.sql.Date.class);
    helpTestMod(// $NON-NLS-1$
    arg1, // $NON-NLS-1$
    "Month", // $NON-NLS-1$
    "rtrim(TO_CHAR({d '2004-01-21'}, 'Month'))");
}
Also used : Literal(org.teiid.language.Literal)

Aggregations

Literal (org.teiid.language.Literal)82 Test (org.junit.Test)19 ArrayList (java.util.ArrayList)18 Expression (org.teiid.language.Expression)17 TranslatorException (org.teiid.translator.TranslatorException)16 Function (org.teiid.language.Function)15 Argument (org.teiid.language.Argument)12 ColumnReference (org.teiid.language.ColumnReference)10 Column (org.teiid.metadata.Column)10 Comparison (org.teiid.language.Comparison)9 ExpressionValueSource (org.teiid.language.ExpressionValueSource)7 List (java.util.List)5 Call (org.teiid.language.Call)5 UnsupportedEncodingException (java.io.UnsupportedEncodingException)4 BinaryWSProcedureExecution (org.teiid.translator.ws.BinaryWSProcedureExecution)4 DBCollection (com.mongodb.DBCollection)3 Timestamp (java.sql.Timestamp)3 Array (org.teiid.language.Array)3 Command (org.teiid.language.Command)3 Insert (org.teiid.language.Insert)3