dawidwys commented on a change in pull request #11070: [FLINK-16013][core] Make 
complex type config options could be parsed correctly
URL: https://github.com/apache/flink/pull/11070#discussion_r383140667
 
 

 ##########
 File path: 
flink-core/src/main/java/org/apache/flink/configuration/Configuration.java
 ##########
 @@ -958,6 +959,15 @@ private String convertToString(Object o) {
                } else if (o.getClass() == Duration.class) {
                        Duration duration = (Duration) o;
                        return String.format("%d ns", duration.toNanos());
+               } else if (o instanceof List) {
+                       return ((List<?>) o).stream()
+                               .map(e -> 
escapeWithSingleQuote(convertToString(e), ";"))
+                               .collect(Collectors.joining(";"));
+               } else if (o instanceof Map) {
+                       return ((Map<?, ?>) o).entrySet().stream()
+                               .map(e -> 
escapeWithSingleQuote(escapeWithSingleQuote(e.getKey().toString(), ":") + ":"
+                                               + 
escapeWithSingleQuote(e.getValue().toString(), ":"), ","))
 
 Review comment:
   How about we make it a bit more readable?
   
   ```
                                .map(e -> {
                                        String escapedKey = 
escapeWithSingleQuote(e.getKey().toString(), ":");
                                        String escapedValue = 
escapeWithSingleQuote(e.getValue().toString(), ":");
   
                                        return escapeWithSingleQuote(escapedKey 
+ ":" + escapedValued, ",");
                                })
   ```

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to