docete commented on a change in pull request #10745:
[FLINK-15445][connectors/jdbc] JDBC Table Source didn't work for Type…
URL: https://github.com/apache/flink/pull/10745#discussion_r376266784
##########
File path:
flink-connectors/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/JDBCTableSource.java
##########
@@ -73,17 +75,23 @@ private JDBCTableSource(
this.selectFields = selectFields;
final TypeInformation<?>[] schemaTypeInfos =
schema.getFieldTypes();
+ final DataType[] schemaDataTypes = schema.getFieldDataTypes();
final String[] schemaFieldNames = schema.getFieldNames();
if (selectFields != null) {
TypeInformation<?>[] typeInfos = new
TypeInformation[selectFields.length];
- String[] typeNames = new String[selectFields.length];
+ DataType[] dataTypes = new
DataType[selectFields.length];
+ String[] fieldNames = new String[selectFields.length];
for (int i = 0; i < selectFields.length; i++) {
typeInfos[i] = schemaTypeInfos[selectFields[i]];
- typeNames[i] =
schemaFieldNames[selectFields[i]];
+ dataTypes[i] = schemaDataTypes[selectFields[i]];
+ fieldNames[i] =
schemaFieldNames[selectFields[i]];
}
- this.returnType = new RowTypeInfo(typeInfos, typeNames);
+ this.returnType = new RowTypeInfo(typeInfos,
fieldNames);
Review comment:
Make sense.
----------------------------------------------------------------
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