Java Code Examples for org.apache.calcite.sql.type.SqlTypeName#getNameForJdbcType()

The following examples show how to use org.apache.calcite.sql.type.SqlTypeName#getNameForJdbcType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SqlTypeNameTest.java    From calcite with Apache License 2.0 5 votes vote down vote up
@Test void testLongnvarchar() {
  SqlTypeName tn =
      SqlTypeName.getNameForJdbcType(ExtraSqlTypes.LONGNVARCHAR);

  // LONGNVARCHAR not supported yet
  assertEquals(null, tn, "LONGNVARCHAR maps to non-null type");
}
 
Example 2
Source File: SqlTypeNameTest.java    From calcite with Apache License 2.0 5 votes vote down vote up
@Test void testRowid() {
  SqlTypeName tn =
      SqlTypeName.getNameForJdbcType(ExtraSqlTypes.ROWID);

  // ROWID not supported yet
  assertEquals(null, tn, "ROWID maps to non-null type");
}
 
Example 3
Source File: SqlTypeNameTest.java    From calcite with Apache License 2.0 5 votes vote down vote up
@Test void testNvarchar() {
  SqlTypeName tn =
      SqlTypeName.getNameForJdbcType(ExtraSqlTypes.NVARCHAR);

  // NVARCHAR not supported yet, currently maps to VARCHAR
  assertEquals(VARCHAR, tn, "NVARCHAR did not map to VARCHAR");
}
 
Example 4
Source File: SqlTypeNameTest.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Test void testBinary() {
  SqlTypeName tn =
      SqlTypeName.getNameForJdbcType(Types.BINARY);
  assertEquals(BINARY, tn, "BINARY did not map to BINARY");
}
 
Example 5
Source File: LealoneTable.java    From Bats with Apache License 2.0 4 votes vote down vote up
private RelDataType getSqlTypeFromLealoneType(RelDataTypeFactory typeFactory, int type) {
    int sqlType = DataType.convertTypeToSQLType(type);
    SqlTypeName typeName = SqlTypeName.getNameForJdbcType(sqlType);
    return typeFactory.createSqlType(typeName);
    // throw new UnsupportedOperationException("Unsupported type.");
}
 
Example 6
Source File: SqlTypeNameTest.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Test void testTimestamp() {
  SqlTypeName tn =
      SqlTypeName.getNameForJdbcType(Types.TIMESTAMP);
  assertEquals(TIMESTAMP, tn, "TIMESTAMP did not map to TIMESTAMP");
}
 
Example 7
Source File: SqlTypeNameTest.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Test void testStruct() {
  SqlTypeName tn =
      SqlTypeName.getNameForJdbcType(Types.STRUCT);
  assertEquals(STRUCTURED, tn, "STRUCT did not map to null");
}
 
Example 8
Source File: SqlTypeNameTest.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Test void testJavaobject() {
  SqlTypeName tn =
      SqlTypeName.getNameForJdbcType(Types.JAVA_OBJECT);
  assertEquals(null, tn, "JAVA_OBJECT did not map to null");
}
 
Example 9
Source File: SqlTypeNameTest.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Test void testLongvarchar() {
  SqlTypeName tn =
      SqlTypeName.getNameForJdbcType(Types.LONGVARCHAR);
  assertEquals(null, tn, "LONGVARCHAR did not map to null");
}
 
Example 10
Source File: SqlTypeNameTest.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Test void testVarbinary() {
  SqlTypeName tn =
      SqlTypeName.getNameForJdbcType(Types.VARBINARY);
  assertEquals(VARBINARY, tn, "VARBINARY did not map to VARBINARY");
}
 
Example 11
Source File: SqlTypeNameTest.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Test void testChar() {
  SqlTypeName tn =
      SqlTypeName.getNameForJdbcType(Types.CHAR);
  assertEquals(CHAR, tn, "CHAR did not map to CHAR");
}
 
Example 12
Source File: SqlTypeNameTest.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Test void testOther() {
  SqlTypeName tn =
      SqlTypeName.getNameForJdbcType(Types.OTHER);
  assertEquals(null, tn, "OTHER did not map to null");
}
 
Example 13
Source File: SqlTypeNameTest.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Test void testDatalink() {
  SqlTypeName tn =
      SqlTypeName.getNameForJdbcType(Types.DATALINK);
  assertEquals(null, tn, "DATALINK did not map to null");
}
 
Example 14
Source File: SqlTypeNameTest.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Test void testFloat() {
  SqlTypeName tn =
      SqlTypeName.getNameForJdbcType(Types.FLOAT);
  assertEquals(FLOAT, tn, "FLOAT did not map to FLOAT");
}
 
Example 15
Source File: SqlTypeNameTest.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Test void testInteger() {
  SqlTypeName tn =
      SqlTypeName.getNameForJdbcType(Types.INTEGER);
  assertEquals(INTEGER, tn, "INTEGER did not map to INTEGER");
}
 
Example 16
Source File: SqlTypeNameTest.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Test void testSmallint() {
  SqlTypeName tn =
      SqlTypeName.getNameForJdbcType(Types.SMALLINT);
  assertEquals(SMALLINT, tn, "SMALLINT did not map to SMALLINT");
}
 
Example 17
Source File: SqlTypeNameTest.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Test void testTinyint() {
  SqlTypeName tn =
      SqlTypeName.getNameForJdbcType(Types.TINYINT);
  assertEquals(TINYINT, tn, "TINYINT did not map to TINYINT");
}
 
Example 18
Source File: SqlTypeNameTest.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Test void testBit() {
  SqlTypeName tn =
      SqlTypeName.getNameForJdbcType(Types.BIT);
  assertEquals(BOOLEAN, tn, "BIT did not map to BOOLEAN");
}
 
Example 19
Source File: SqlTypeNameTest.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Test void testBoolean() {
  SqlTypeName tn =
      SqlTypeName.getNameForJdbcType(Types.BOOLEAN);
  assertEquals(BOOLEAN, tn, "BOOLEAN did not map to BOOLEAN");
}
 
Example 20
Source File: SqlTypeNameTest.java    From calcite with Apache License 2.0 4 votes vote down vote up
@Test void testNull() {
  SqlTypeName tn =
      SqlTypeName.getNameForJdbcType(Types.NULL);
  assertEquals(null, tn, "NULL did not map to null");
}