@SuppressWarnings("unchecked")
    private JsonNode convertMap(MapFormatInfo mapFormatInfo, String path, Object object) {
        checkState(mapFormatInfo.getKeyFormatInfo() instanceof BasicFormatInfo,
                String.format("The key field format of map must be instanceof BasicFormatInfo, " +
                        "actual is [%s] (path=[%s], data=[%s]).",
                        mapFormatInfo.getKeyFormatInfo().getClass(), path, object));

        BasicFormatInfo<Object> keyFormatInfo =
                (BasicFormatInfo<Object>) mapFormatInfo.getKeyFormatInfo();
        FormatInfo valueFormatInfo = mapFormatInfo.getValueFormatInfo();

        checkState(object instanceof Map,
                String.format("The object must be not typed map, actual type is [%s] (path=[%s], " +
                        "data=[%s]).", object.getClass(), path, object));
        Map<Object, Object> map = (Map<Object, Object>) object;

        ObjectNode node = objectMapper.createObjectNode();
        for (Map.Entry<Object, Object> entry : map.entrySet()) {
            Object key = entry.getKey();
            String keyText;
            try {
                keyText = keyFormatInfo.serialize(entry.getKey());
            } catch (Throwable t) {
                throw new RuntimeException(
                        String.format("Could not properly deserialize the key (path=[%s], data=[%s]).",
                                path, key),
                        t);
            }

            String childPath = path + "<" + keyText + ">";
            Object childObject = entry.getValue();
            JsonNode value = convert(valueFormatInfo, childPath, childObject);

            node.set(keyText, value);
        }

        return node;
    }
Object mapper that is used to create output JSON objects.
inlong-sort/sort-formats/format-rowdata/format-rowdata-json/src/main/java/org/apache/inlong/sort/formats/json/JsonRowSerializationSchema.java