private JsonToLogDataConverter<T> createMapConverter(Type type) {
    Types.MapType map = type.asNestedType().asMapType();
    Types.NestedField keyField = map.field(map.keyId());
    Types.NestedField valueField = map.field(map.valueId());
    final JsonToLogDataConverter<T> keyConverter = createConverter(keyField.type());
    final JsonToLogDataConverter<T> valueConverter = createConverter(valueField.type());
    return (jsonNode, context) -> {
      Iterator<Map.Entry<String, JsonNode>> fields = jsonNode.fields();
      Map<Object, Object> result = new HashMap<>();
      while (fields.hasNext()) {
        Map.Entry<String, JsonNode> entry = fields.next();
        Object key = keyConverter.convert(TextNode.valueOf(entry.getKey()), context);
        Object value = valueConverter.convert(entry.getValue(), context);
        key = convertSecondTimeIfNecessary(keyField.type(), key);
        value = convertSecondTimeIfNecessary(valueField.type(), value);
        result.put(key, value);
      }
      return mapFactory.create(result);
    };
  }
Converter to convert {@link JsonNode} to log data.

@param <T> to indicate the log data type
amoro-format-iceberg/src/main/java/org/apache/amoro/log/JsonToLogDataConverters.java