You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "liuml07 (via GitHub)" <gi...@apache.org> on 2023/05/08 23:02:57 UTC

[GitHub] [flink-connector-jdbc] liuml07 commented on a diff in pull request #4: [FLINK-29750][Connector/JDBC] Improve PostgresCatalog#listTables() by reusing resources

liuml07 commented on code in PR #4:
URL: https://github.com/apache/flink-connector-jdbc/pull/4#discussion_r1187972768


##########
flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/catalog/AbstractJdbcCatalog.java:
##########
@@ -522,6 +509,25 @@ protected List<String> extractColumnValuesBySQL(
         }
     }
 
+    protected static List<String> extractColumnValuesByStatement(
+            PreparedStatement ps, int columnIndex, Predicate<String> filterFunc, Object... params)
+            throws SQLException {
+        List<String> columnValues = Lists.newArrayList();
+        if (Objects.nonNull(params) && params.length > 0) {
+            for (int i = 0; i < params.length; i++) {
+                ps.setObject(i + 1, params[i]);
+            }
+        }
+        ResultSet rs = ps.executeQuery();

Review Comment:
   Sounds good. Updated. thanks



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

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org