wuchong commented on a change in pull request #11538: [FLINK-16813][jdbc] JDBCInputFormat doesn't correctly map Short URL: https://github.com/apache/flink/pull/11538#discussion_r401435369
########## File path: flink-connectors/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/JDBCInputFormat.java ########## @@ -127,7 +134,7 @@ public JDBCInputFormat() { @Override public RowTypeInfo getProducedType() { - return rowTypeInfo; + return (RowTypeInfo) fromDataTypeToLegacyInfo(fromLogicalToDataType(rowType)); Review comment: Yes. They are orthogonal. The reason we should use `TypeInformation` instead of `RowType` is `InputFormat` only works with `TypeInformation` and `RowType` is a concept of table world. The community is trying to reuse runtime implementation as much as possible. So a better design is that `JDBCInputFormat` accepts result `TypeInformation` and `JDBCConverter` as constructor parameters. So that, we can easily support generic type for DataStream users in the futrue. We already refactored JDBC sink function to support generic type (see `JdbcBatchingOutputFormat`), and will refactor JDBC source soon. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services