### Question:
CassandraTypesUtils { public static DataType getDataType( PolyType polyType, UserDefinedType arrayContainerUdt ) { switch ( polyType ) { case BOOLEAN: return DataTypes.BOOLEAN; case TINYINT: return DataTypes.TINYINT; case SMALLINT: return DataTypes.SMALLINT; case INTEGER: return DataTypes.INT; case BIGINT: return DataTypes.BIGINT; case DECIMAL: return DataTypes.DECIMAL; case FLOAT: case REAL: return DataTypes.FLOAT; case DOUBLE: return DataTypes.DOUBLE; case DATE: return DataTypes.DATE; case TIME: case TIME_WITH_LOCAL_TIME_ZONE: return DataTypes.TIME; case TIMESTAMP: case TIMESTAMP_WITH_LOCAL_TIME_ZONE: return DataTypes.TIMESTAMP; case INTERVAL_YEAR: case INTERVAL_YEAR_MONTH: case INTERVAL_MONTH: case INTERVAL_DAY: case INTERVAL_DAY_HOUR: case INTERVAL_DAY_MINUTE: case INTERVAL_DAY_SECOND: case INTERVAL_HOUR: case INTERVAL_HOUR_MINUTE: case INTERVAL_HOUR_SECOND: case INTERVAL_MINUTE: case INTERVAL_MINUTE_SECOND: case INTERVAL_SECOND: throw new RuntimeException( "Intervals are WIP." ); case CHAR: case VARCHAR: return DataTypes.TEXT; case BINARY: case VARBINARY: return DataTypes.BLOB; case ARRAY: return arrayContainerUdt; case NULL: case ANY: case SYMBOL: case MULTISET: case MAP: case DISTINCT: case STRUCTURED: case ROW: case OTHER: case CURSOR: case COLUMN_LIST: case DYNAMIC_STAR: case GEOMETRY: break; } throw new RuntimeException( "Unable to convert sql type: " + polyType.getName() ); }  static DataType getDataType( PolyType polyType, UserDefinedType arrayContainerUdt ); static PolyType getPolyType( DataType dataType ); static Class<?> getJavaType( DataType dataType ); static Function<Object, Object> convertToFrom( PolyType to, PolyType from ); static UdtValue createArrayContainerDataType( UserDefinedType arrayUdt, int dimension, int cardinality, PolyType innerType, RexCall arrayCall ); static List<Object> unparseArrayContainerUdt( UdtValue arrayContainer );  }### Answer:
@Test public void simplePolyTypeToCassandraType() { assertEquals( DataTypes.BOOLEAN, getDataType( PolyType.BOOLEAN, null ) ); assertEquals( DataTypes.TINYINT, getDataType( PolyType.TINYINT, null ) ); assertEquals( DataTypes.SMALLINT, getDataType( PolyType.SMALLINT, null ) ); assertEquals( DataTypes.INT, getDataType( PolyType.INTEGER, null ) ); assertEquals( DataTypes.BIGINT, getDataType( PolyType.BIGINT, null ) ); assertEquals( DataTypes.FLOAT, getDataType( PolyType.FLOAT, null ) ); assertEquals( DataTypes.DOUBLE, getDataType( PolyType.DOUBLE, null ) ); assertEquals( DataTypes.DECIMAL, getDataType( PolyType.DECIMAL, null ) ); assertEquals( DataTypes.DATE, getDataType( PolyType.DATE, null ) ); assertEquals( DataTypes.TIME, getDataType( PolyType.TIME, null ) ); assertEquals( DataTypes.TIME, getDataType( PolyType.TIME_WITH_LOCAL_TIME_ZONE, null ) ); assertEquals( DataTypes.TIMESTAMP, getDataType( PolyType.TIMESTAMP, null ) ); assertEquals( DataTypes.TIMESTAMP, getDataType( PolyType.TIMESTAMP_WITH_LOCAL_TIME_ZONE, null ) ); assertEquals( DataTypes.TEXT, getDataType( PolyType.CHAR, null ) ); assertEquals( DataTypes.TEXT, getDataType( PolyType.VARCHAR, null ) ); assertEquals( DataTypes.BLOB, getDataType( PolyType.BINARY, null ) ); assertEquals( DataTypes.BLOB, getDataType( PolyType.VARBINARY, null ) ); }