wuchong commented on a change in pull request #13669: URL: https://github.com/apache/flink/pull/13669#discussion_r508466369
########## File path: flink-connectors/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/table/JdbcDynamicTableFactory.java ########## @@ -308,6 +308,14 @@ private void validateConfigOptions(ReadableConfig config) { LOOKUP_CACHE_MAX_ROWS, LOOKUP_CACHE_TTL }); + + if (config.get(LOOKUP_MAX_RETRIES) <= 0) { + throw new IllegalArgumentException("The 'lookup.max-retries' should be greater than 0."); Review comment: Use the option variable instead of hard code the option key. ########## File path: flink-connectors/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/table/JdbcDynamicTableFactory.java ########## @@ -308,6 +308,14 @@ private void validateConfigOptions(ReadableConfig config) { LOOKUP_CACHE_MAX_ROWS, LOOKUP_CACHE_TTL }); + + if (config.get(LOOKUP_MAX_RETRIES) <= 0) { + throw new IllegalArgumentException("The 'lookup.max-retries' should be greater than 0."); + } + + if (config.get(SINK_MAX_RETRIES) <= 0) { + throw new IllegalArgumentException("The 'sink.max-retries' should be greater than 0."); Review comment: ditto. ########## File path: flink-connectors/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/table/JdbcDynamicTableFactory.java ########## @@ -308,6 +308,14 @@ private void validateConfigOptions(ReadableConfig config) { LOOKUP_CACHE_MAX_ROWS, LOOKUP_CACHE_TTL }); + + if (config.get(LOOKUP_MAX_RETRIES) <= 0) { Review comment: I think it can equal to zero? ########## File path: flink-connectors/flink-connector-jdbc/src/main/java/org/apache/flink/connector/jdbc/table/JdbcDynamicTableFactory.java ########## @@ -308,6 +308,14 @@ private void validateConfigOptions(ReadableConfig config) { LOOKUP_CACHE_MAX_ROWS, LOOKUP_CACHE_TTL }); + + if (config.get(LOOKUP_MAX_RETRIES) <= 0) { + throw new IllegalArgumentException("The 'lookup.max-retries' should be greater than 0."); Review comment: ```java throw new IllegalArgumentException(String.format( "The value of '%s' option shouldn't be negative, but is %s.", LOOKUP_MAX_RETRIES.key(), config.get(LOOKUP_MAX_RETRIES))); ``` ---------------------------------------------------------------- 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