Search in sources :

Example 51 with SqlTypeName

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

the class SqlTypeNameTest method testTinyint.

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

Example 52 with SqlTypeName

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

the class SqlTypeNameTest method testDecimal.

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

Example 53 with SqlTypeName

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

the class SqlTypeNameTest method testStruct.

@Test
void testStruct() {
    SqlTypeName tn = SqlTypeName.getNameForJdbcType(Types.STRUCT);
    assertEquals(STRUCTURED, tn, "STRUCT did not map to null");
}
Also used : SqlTypeName(org.apache.calcite.sql.type.SqlTypeName) Test(org.junit.jupiter.api.Test)

Example 54 with SqlTypeName

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

the class SqlTypeNameTest method testDatalink.

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

Example 55 with SqlTypeName

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

the class SqlTypeNameTest method testRowid.

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

Aggregations

SqlTypeName (org.apache.calcite.sql.type.SqlTypeName)184 RelDataType (org.apache.calcite.rel.type.RelDataType)62 Test (org.junit.jupiter.api.Test)39 List (java.util.List)31 BigDecimal (java.math.BigDecimal)30 ArrayList (java.util.ArrayList)30 ImmutableList (com.google.common.collect.ImmutableList)26 RelDataTypeField (org.apache.calcite.rel.type.RelDataTypeField)26 Map (java.util.Map)25 RexNode (org.apache.calcite.rex.RexNode)25 NlsString (org.apache.calcite.util.NlsString)21 DateString (org.apache.calcite.util.DateString)18 TimeString (org.apache.calcite.util.TimeString)18 TimestampString (org.apache.calcite.util.TimestampString)18 ByteString (org.apache.calcite.avatica.util.ByteString)17 RelDataTypeFactory (org.apache.calcite.rel.type.RelDataTypeFactory)16 SqlKind (org.apache.calcite.sql.SqlKind)15 Calendar (java.util.Calendar)14 Objects (java.util.Objects)13 Util (org.apache.calcite.util.Util)13