wuchong commented on a change in pull request #9236: [FLINK-13283][jdbc] Fix
JDBC connectors with DataTypes.DATE/TIME/TIMESTAMP support
URL: https://github.com/apache/flink/pull/9236#discussion_r308039934
##########
File path:
flink-connectors/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/JDBCInputFormat.java
##########
@@ -292,8 +302,10 @@ public Row nextRecord(Row row) throws IOException {
if (!hasNext) {
return null;
}
+ TypeInformation[] fieldTypes =
rowTypeInfo.getFieldTypes();
for (int pos = 0; pos < row.getArity(); pos++) {
- row.setField(pos, resultSet.getObject(pos + 1));
+ row.setField(pos, JDBCUtils.timeObjectCast(
Review comment:
Can we combine the `JDBCUtils.timeObjectCast` with
`JDBCUtils.getFieldFromResultSet`, e.g. `getField(ResultSet set, int index, int
logicalType, Class<?> physicalType)` ? We should have an inverse method of
`JDBCUtils.setField`.
It is strange to use a `timeObjectCast` here, because the object may not a
time object.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services