public static String jsonArrayAppend(String jsonDoc, ArrayList<Object> pathValuePairs) {
        if (jsonDoc == null || pathValuePairs == null || pathValuePairs.size() % 2 != 0) {
            return null;
        }

        Object jsonObject;
        try {
            jsonObject = JSON.parse(jsonDoc);
        } catch (Exception e) {
            throw new IllegalArgumentException("Invalid JSON document", e);
        }

        // Process each pair of path and val
        for (int i = 0; i < pathValuePairs.size(); i += 2) {
            String path = (String) pathValuePairs.get(i);
            Object value = pathValuePairs.get(i + 1);

            // Attempt to append a value to the array pointed to by the specified path
            try {
                jsonObject = appendValueToArray(jsonObject, path, JSON.parse(value.toString()));
            } catch (Exception e) {
                jsonObject = appendValueToArray(jsonObject, path, value);
            }
        }

        return JSON.toJSONString(jsonObject);
    }
JsonArrayAppendFunction   ->   JSON_ARRAY_APPEND(json_doc, path, val[, path, val] ...)
description:
- Return NULL if any argument is NULL.
- Return the result of appends values to the end of the indicated arrays within a JSON document.
inlong-sdk/transform-sdk/src/main/java/org/apache/inlong/sdk/transform/process/function/json/JsonArrayAppendFunction.java