Supported data types
You should review the supported data types before designing your application to have all the information regarding SQL type mappings, timestamp and date types.
Java to SQL type mappings
SQL Type | From DataStream |
To DataStream |
---|---|---|
STRING |
String | String |
BOOLEAN |
boolean/Boolean | boolean/Boolean |
BYTES |
byte[] | byte[] |
DECIMAL(38,18) |
BigDecimal | BigDecimal |
TINYINT |
byte/Byte | byte |
SMALLINT |
short/Short | short/Short |
INT |
int/Integer | int/Integer |
BIGINT |
long/Long | long/Long |
FLOAT |
float/Float | float/Float |
DOUBLE |
double/Double | double/Double |
MAP |
Maps of supported types using MapTypeInfo |
Maps of supported types |
ARRAY |
primitive/object arrays | primitive/object arrays* |
ROW |
Row | Row |
Timestamp and Date types
The Table API supports a wide variety of conversions between
java.sql
,
java.time
and SQL types. For smooth operation, it is recommended to use
java.sql
time classes whenever possible.To DataStream |
|||
---|---|---|---|
SQL Type | From DataStream |
Tuple | Row |
DATE |
java.sql.Date |
java.sql.Date |
java.time.LocalDate |
java.time.LocalDate * |
java.time.LocalDate * |
||
TIME(0) |
java.sql.Time |
java.sql.Time |
java.time.LocalTime |
java.time.LocalTime * |
java.time.LocalTime * |
||
TIMESTAMP(3) |
java.sql.Timestamp |
java.sql.Timestamp |
java.time.LocalDateTime |
java.time.LocalDateTime (no .rowtime support) * |
java.time.LocalDateTime * |
||
TIMESTAMP_WITH_LOCAL_TIME_ZONE |
java.time.Instant * |
java.time.Instant * |
java.time.Instant |