wangxlong commented on a change in pull request #14387:
URL: https://github.com/apache/flink/pull/14387#discussion_r547605618



##########
File path: 
flink-connectors/flink-connector-jdbc/src/test/java/org/apache/flink/connector/jdbc/table/JdbcDynamicTableFactoryTest.java
##########
@@ -339,6 +341,18 @@ public void testJdbcValidation() {
                                "The value of 'sink.max-retries' option 
shouldn't be negative, but is -1.")
                                .isPresent());
                }
+
+               // connection.max-retry-timeout should be positive

Review comment:
       // connection.max-retry-timeout shouldn't be smaller than 1 second

##########
File path: 
flink-connectors/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/table/JdbcDynamicTableFactory.java
##########
@@ -192,7 +197,9 @@ private JdbcOptions getJdbcOptions(ReadableConfig 
readableConfig) {
                        .setDBUrl(url)
                        .setTableName(readableConfig.get(TABLE_NAME))
                        .setDialect(JdbcDialects.get(url).get())
-                       
.setParallelism(readableConfig.getOptional(FactoryUtil.SINK_PARALLELISM).orElse(null));
+                       
.setParallelism(readableConfig.getOptional(FactoryUtil.SINK_PARALLELISM).orElse(null))
+                       .setConnectionCheckTimeoutSeconds((int) 
readableConfig.get(MAX_RETRY_TIMEOUT).getSeconds());
+

Review comment:
       Delete the extra blank line

##########
File path: 
flink-connectors/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/table/JdbcLookupFunction.java
##########
@@ -177,7 +178,7 @@ public void eval(Object... keys) {
                                }
 
                                try {
-                                       if 
(!dbConn.isValid(CONNECTION_CHECK_TIMEOUT_SECONDS)) {
+                                       if 
(!dbConn.isValid(connectionCheckTimeoutSeconds)) {

Review comment:
       We should also add property in `JdbcTableSourceSinkFactory` and add test 
in `JdbcTableSourceSinkFactoryTest`, for this is a legacy lookup function. You 
can refer to the commit I provided.




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


Reply via email to