private void insertIntoArray(JSONArray array, String path, Object value) {
        String indexPart = path.substring(path.lastIndexOf('[') + 1, path.lastIndexOf(']'));
        int index = Integer.parseInt(indexPart);

        // If the index exceeds the length of the array, insert at the end
        if (index >= array.size()) {
            index = array.size();
        }
        try {
            array.add(index, JSON.parse(value.toString()));
        } catch (Exception ignored) {
            array.add(index, value);
        }
    }
JsonArrayInsertFunction   ->  JSON_ARRAY_INSERT(json_doc, path, val[, path, val] ...)
description:
- return NULL if any argument is NULL;
- return the document inserted into the array.
Note: If multiple groups of parameters are passed in, the parameter subscripts of the latter groups
need to be based on the document subscripts after the previous group of parameters are updated.
inlong-sdk/transform-sdk/src/main/java/org/apache/inlong/sdk/transform/process/function/json/JsonArrayInsertFunction.java