@SuppressWarnings("unchecked")
    private JsonNode convertBasic(BasicFormatInfo<?> basicFormatInfo, String path, Object object) {
        if (object == null) {
            return objectMapper.getNodeFactory().nullNode();
        }

        try {
            if (basicFormatInfo instanceof BooleanFormatInfo) {
                return objectMapper.getNodeFactory().booleanNode((Boolean) object);
            } else if (basicFormatInfo instanceof ByteFormatInfo ||
                    basicFormatInfo instanceof ShortFormatInfo ||
                    basicFormatInfo instanceof IntFormatInfo ||
                    basicFormatInfo instanceof LongFormatInfo) {
                return objectMapper.getNodeFactory().numberNode(((Number) object).longValue());
            } else if (basicFormatInfo instanceof FloatFormatInfo) {
                return objectMapper.getNodeFactory().numberNode((Float) object);
            } else if (basicFormatInfo instanceof DoubleFormatInfo) {
                return objectMapper.getNodeFactory().numberNode((Double) object);
            } else if (basicFormatInfo instanceof DecimalFormatInfo) {
                return objectMapper.getNodeFactory().numberNode((BigDecimal) object);
            } else {
                String text = ((BasicFormatInfo<Object>) basicFormatInfo).serialize(object);
                return objectMapper.getNodeFactory().textNode(text);
            }
        } catch (Throwable t) {
            throw new RuntimeException(
                    String.format("Could not properly serialize the value (path=[%s], data=[%s]).",
                            path, object),
                    t);
        }
    }
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