leonardBang commented on a change in pull request #10468: [FLINK-14649][table 
sql / api] Flatten all the connector properties keys to make it easy to 
configure in DDL
URL: https://github.com/apache/flink/pull/10468#discussion_r355161684
 
 

 ##########
 File path: 
flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/table/descriptors/ElasticsearchValidator.java
 ##########
 @@ -87,7 +93,12 @@ private void validateHosts(DescriptorProperties properties) 
{
                hostsValidators.put(CONNECTOR_HOSTS_HOSTNAME, (key) -> 
properties.validateString(key, false, 1));
                hostsValidators.put(CONNECTOR_HOSTS_PORT, (key) -> 
properties.validateInt(key, false, 0, 65535));
                hostsValidators.put(CONNECTOR_HOSTS_PROTOCOL, (key) -> 
properties.validateString(key, false, 1));
-               properties.validateFixedIndexedProperties(CONNECTOR_HOSTS, 
false, hostsValidators);
+
+               if (properties.containsKey(CONNECTOR_HOSTS)) {
+                       validateAndGetHostsStr(properties);
 
 Review comment:
   we'd better parse and validate at the same time because 
`DescriptorProperties` do not support `Consumer` that can validate `String` 
value  like `partition:0,offset:42;partition:1,offset:300`

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


With regards,
Apache Git Services

Reply via email to