private JsonNode convert(RowFormatInfo rowFormatInfo, String path, Object object) {
        String[] fieldNames = rowFormatInfo.getFieldNames();
        FormatInfo[] fieldFormatInfos = rowFormatInfo.getFieldFormatInfos();

        checkState(object instanceof Row,
                String.format("The object is not typed row, actual type is [%s] (path=[%s], " +
                        "data=[%s]).", object.getClass(), path, object));

        Row row = (Row) object;

        if (row.getArity() != fieldFormatInfos.length) {
            LOGGER.warn("The number of fields mismatches: expected=[{}], actual=[{}] (path=[{}], " +
                    "data=[{}].", fieldFormatInfos.length, row.getArity(), path, object);
        }

        ObjectNode node = objectMapper.createObjectNode();

        int numActualFields = Math.min(row.getArity(), fieldFormatInfos.length);
        for (int i = 0; i < numActualFields; i++) {
            String fieldName = fieldNames[i];

            String childPath = path + "." + fieldName;
            Object childObject = row.getField(i);

            if (childObject == null) {
                continue;
            }

            node.set(fieldName, convert(fieldFormatInfos[i], childPath, childObject));
        }

        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