static String getSQLTypeName ( Field . Type type ) throws OnRecordErrorException { switch ( type ) { case BOOLEAN : return "BOOLEAN" ; case CHAR : return "CHAR" ; case BYTE : return "BINARY" ; case SHORT : return "SMALLINT" ; case INTEGER : return "INTEGER" ; case LONG : return "BIGINT" ; case FLOAT : return "FLOAT" ; case DOUBLE : return "DOUBLE" ; case DATE : return "DATE" ; case TIME : return "TIME" ; case DATETIME : return "TIMESTAMP" ; case DECIMAL : return "DECIMAL" ; case STRING : return "VARCHAR" ; case BYTE_ARRAY : return "VARBINARY" ; case LIST_MAP : case MAP : throw new OnRecordErrorException ( JdbcErrors . JDBC_05 , "Unsupported list or map type: MAP" ) ; case LIST : return "ARRAY" ; default : throw new OnRecordErrorException ( JdbcErrors . JDBC_05 , "Unsupported type: " + type . name ( ) ) ; } }
spec requires a string name for a data type rather than just an enum .