wuchong 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_r362465428
 
 

 ##########
 File path: 
flink-connectors/flink-jdbc/src/main/java/org/apache/flink/api/java/io/jdbc/JDBCTableSource.java
 ##########
 @@ -180,6 +193,20 @@ public boolean equals(Object o) {
                }
        }
 
+       @Override
+       public String explainSource() {
+               if (selectFields == null) {
+                       return String.format(
+                               "JDBCTableSource(read fields: %s)", 
String.join(", ", schema.getFieldNames()));
+               } else {
+                       String[] fields = new String[selectFields.length];
+                       for (int i = 0; i < selectFields.length; i++) {
+                               fields[i] = 
schema.getFieldName(selectFields[i]).get();
+                       }
+                       return String.format("JDBCTableSource(read fields: 
%s)", String.join(", ", fields));
 
 Review comment:
   Use `returnType.getFieldNames` instead reconstruct the selected field names 
again?

----------------------------------------------------------------
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

Reply via email to