healchow commented on code in PR #6979: URL: https://github.com/apache/inlong/pull/6979#discussion_r1052902554
########## inlong-sort/sort-connectors/jdbc/src/main/java/org/apache/inlong/sort/jdbc/dialect/PostgresDialect.java: ########## @@ -137,4 +146,71 @@ public List<LogicalTypeRoot> unsupportedTypes() { LogicalTypeRoot.SYMBOL, LogicalTypeRoot.UNRESOLVED); } + + @Override + public List<String> getAndSetPkNamesFromDb(String tableIdentifier, JdbcOptions jdbcOptions) { + PreparedStatement st = null; + try { + JdbcOptions jdbcExecOptions = + JdbcOptions.builder() + .setDBUrl(jdbcOptions.getDbURL() + "/" + + JdbcMultiBatchingComm.getTDbNameFromIdentifier(tableIdentifier)) + .setTableName(JdbcMultiBatchingComm.getTbNameFromIdentifier(tableIdentifier)) + .setDialect(jdbcOptions.getDialect()) + .setParallelism(jdbcOptions.getParallelism()) + .setConnectionCheckTimeoutSeconds(jdbcOptions.getConnectionCheckTimeoutSeconds()) + .setDriverName(jdbcOptions.getDriverName()) + .setUsername(jdbcOptions.getUsername().orElse("")) + .setPassword(jdbcOptions.getPassword().orElse("")) + .build(); + SimpleJdbcConnectionProvider tableConnectionProvider = new SimpleJdbcConnectionProvider(jdbcExecOptions); + Connection conn = tableConnectionProvider.getOrEstablishConnection(); Review Comment: Does this connection need to close? -- 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: commits-unsubscr...@inlong.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org