Search in sources :

Example 16 with SqlTypeName

use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.sql.type.SqlTypeName in project calcite by apache.

the class SqlTypeNameTest method testNumeric.

@Test
public void testNumeric() {
    SqlTypeName tn = SqlTypeName.getNameForJdbcType(Types.NUMERIC);
    assertEquals("NUMERIC did not map to DECIMAL", SqlTypeName.DECIMAL, tn);
}
Also used : SqlTypeName(org.apache.calcite.sql.type.SqlTypeName) Test(org.junit.Test)

Example 17 with SqlTypeName

use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.sql.type.SqlTypeName in project calcite by apache.

the class SqlTypeNameTest method testLongvarchar.

@Test
public void testLongvarchar() {
    SqlTypeName tn = SqlTypeName.getNameForJdbcType(Types.LONGVARCHAR);
    assertEquals("LONGVARCHAR did not map to null", null, tn);
}
Also used : SqlTypeName(org.apache.calcite.sql.type.SqlTypeName) Test(org.junit.Test)

Example 18 with SqlTypeName

use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.sql.type.SqlTypeName in project calcite by apache.

the class SqlTypeNameTest method testNclob.

@Test
public void testNclob() {
    SqlTypeName tn = SqlTypeName.getNameForJdbcType(ExtraSqlTypes.NCLOB);
    // NCLOB not supported yet
    assertEquals("NCLOB maps to non-null type", null, tn);
}
Also used : SqlTypeName(org.apache.calcite.sql.type.SqlTypeName) Test(org.junit.Test)

Example 19 with SqlTypeName

use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.sql.type.SqlTypeName in project calcite by apache.

the class SqlTypeNameTest method testTimestamp.

@Test
public void testTimestamp() {
    SqlTypeName tn = SqlTypeName.getNameForJdbcType(Types.TIMESTAMP);
    assertEquals("TIMESTAMP did not map to TIMESTAMP", SqlTypeName.TIMESTAMP, tn);
}
Also used : SqlTypeName(org.apache.calcite.sql.type.SqlTypeName) Test(org.junit.Test)

Example 20 with SqlTypeName

use of org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.sql.type.SqlTypeName in project calcite by apache.

the class SqlTypeNameTest method testLongnvarchar.

@Test
public void testLongnvarchar() {
    SqlTypeName tn = SqlTypeName.getNameForJdbcType(ExtraSqlTypes.LONGNVARCHAR);
    // LONGNVARCHAR not supported yet
    assertEquals("LONGNVARCHAR maps to non-null type", null, tn);
}
Also used : SqlTypeName(org.apache.calcite.sql.type.SqlTypeName) Test(org.junit.Test)

Aggregations

SqlTypeName (org.apache.calcite.sql.type.SqlTypeName)116 Test (org.junit.Test)38 RelDataType (org.apache.calcite.rel.type.RelDataType)28 RexNode (org.apache.calcite.rex.RexNode)18 BigDecimal (java.math.BigDecimal)13 ArrayList (java.util.ArrayList)12 List (java.util.List)11 RelDataTypeFactory (org.apache.calcite.rel.type.RelDataTypeFactory)8 RelDataTypeField (org.apache.calcite.rel.type.RelDataTypeField)8 ImmutableList (com.google.common.collect.ImmutableList)7 Map (java.util.Map)7 DateString (org.apache.calcite.util.DateString)7 TimeString (org.apache.calcite.util.TimeString)7 TimestampString (org.apache.calcite.util.TimestampString)7 ISE (io.druid.java.util.common.ISE)6 SqlKind (org.apache.calcite.sql.SqlKind)6 NlsString (org.apache.calcite.util.NlsString)6 Calendar (java.util.Calendar)5 Nullable (javax.annotation.Nullable)5 RexBuilder (org.apache.calcite.rex.RexBuilder)5