...
The following basic flink data types are supported to convert to sql data type in this FLIP, and more types can be supported as needed in the future.
Flink Data Type |
Java Sql Data Type | Java Data Type | |
CharType/VarCharType | CHAR/VARCHAR | String |
BooleanType | BOOLEAN | Boolean |
TinyIntType | TINYINT | Byte |
SmallIntType | SMALLINT | Short |
IntType | INTEGER | Int |
BigIntType | BIGINT | Long |
FloatType | FLOAT | Float |
DoubleType | DOUBLE | Double |
DecimalType | DECIMAL | BigDecimal |
BinaryType/VarBinaryType |
BINARY/VARBINARY | byte[] |
DateType | DATE | Date |
TimeType | TIME | Time |
TimestampType | TIMESTAMP | Timestamp |
ZonedTimestapType | TIMESTAMP_WITH_TIMEZONE | ZonedDateTime |
ArrayType | ARRAY | Array |
RowType | ROW | Row(Flink Row Data) |
MapType | MAP | Map<K, V> |
ArrayType
Public Interface
There are many methods in Jdbc Driver, while this FLIP only implement the basic methods first and more methods will be implemented later when they are needed.
...
- Methods in
FlinkResultSet
:FlinkResultSet
only supports fetching data from iteratorStatementResult
, it supports getXXX methods and doesn't support deleting, updating or moving the cursor. Compare withResultSet
, there isgetKind
method inFlinkResultSet
to get theRowKind
of current record.
Code Block | ||
---|---|---|
| ||
/* ResultSet for flink jdbc driver. */
public class FlinkResultSet implements ResultSet {
/* Get the row kind for the current record. */
public RowKind getKind();
/* Return true if there are more resuts in result iterator. */
@Override
public boolean next() throws SQLException;
/* Close the fetch result operation. */
@Override
public void close() throws SQLException;
/* Get different values according to data type and column index. */
@Override
public <V> V getXXX(int columnIndex) throws SQLException.
/* Get different values according to data type and column name. */
@Override
public <V> V getXXX(String columnName) throws SQLException.
} |
...