private static List<Object> parsePath(String path) {
        if (path == null || !path.startsWith("$")) {
            throw new IllegalArgumentException("Invalid path expression: " + path);
        }

        List<Object> tokens = new ArrayList<>();
        int i = 1; // Skip the '$'
        int len = path.length();

        while (i < len) {
            char c = path.charAt(i);
            if (c == '.') {
                i++;
                int start = i;
                while (i < len && path.charAt(i) != '.' && path.charAt(i) != '[') {
                    i++;
                }
                if (start == i) {
                    throw new IllegalArgumentException("Invalid path expression: " + path);
                }
                String key = path.substring(start, i);
                tokens.add(key);
            } else if (c == '[') {
                i++;
                int start = i;
                while (i < len && path.charAt(i) != ']') {
                    i++;
                }
                if (i == len || path.charAt(i) != ']') {
                    throw new IllegalArgumentException("Invalid path expression: " + path);
                }
                String indexStr = path.substring(start, i);
                i++; // Skip ']'
                try {
                    int index = Integer.parseInt(indexStr);
                    tokens.add(index);
                } catch (NumberFormatException e) {
                    throw new IllegalArgumentException("Invalid array index in path: " + path);
                }
            } else {
                throw new IllegalArgumentException("Invalid path expression: " + path);
            }
        }
        return tokens;
    }
JsonInsertFunction   ->  JSON_INSERT(json_doc, path, val[, path, val, ...])
description:
- return NULL if any argument is NULL or the 'json_doc' argument is not a valid JSON document
         or any path argument is not a valid path expression or contains a * or ** wildcard;
- return the result of inserting data into 'json_doc'.
inlong-sdk/transform-sdk/src/main/java/org/apache/inlong/sdk/transform/process/function/json/JsonInsertFunction.java