private static Map<String, Object> flatten(Map<String, Object> config, String keyPrefix) {
    final Map<String, Object> flattenedMap = new HashMap<>();
    config.forEach(
        (key, value) -> {
          String flattenedKey = keyPrefix + key;
          if (value instanceof Map) {
            Map<String, Object> e = (Map<String, Object>) value;
            flattenedMap.putAll(flatten(e, flattenedKey + "."));
          } else {
            if (value instanceof List) {
              flattenedMap.put(flattenedKey, YamlParserUtils.toYAMLString(value));
            } else {
              flattenedMap.put(flattenedKey, value);
            }
          }
        });

    return flattenedMap;
  }
Copy from flink 1.20 GlobalConfiguration.flatten Utils

@param config
@param keyPrefix
@return
amoro-ams/src/main/java/org/apache/amoro/server/manager/FlinkOptimizerContainer.java