emptyOVO commented on PR #11350:
URL: https://github.com/apache/inlong/pull/11350#issuecomment-2416277183

   now support If the user types the wrong name, it can also match the function 
that may be related
   
   * for example when user type wrong name `json_aray` (`json_array` is correct)
   * return data below: 
   
   ```
   {
        "list": [{
                "name": "json_array_append(String json_doc, String path1, 
String val1[,String path2, String val2, ...])\r\n",
                "explanation": "- Return \"\" if any argument is NULL;\r\n- 
Return the result of appends values to the end of the indicated arrays within a 
JSON document.\r\n",
                "examples": "json_array_append([\"a\", [\"b\", \"c\"], 
\"d\"],$[0],2,$[1],3) \u003d [[\"a\",\"2\"],[\"b\",\"c\",\"3\"],\"d\"]\r\n"
        }, {
                "name": "json_array_insert(String json_doc, String path1, 
String val1[, String path2, String val2, ...] )\r\n",
                "explanation": "- Return \"\" if any argument is NULL;\r\n- 
Return the \u0027json_doc\u0027 inserted into the array.\r\nNote: 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.\r\n",
                "examples": "json_array_append([\"a\", {\"b\": [1, 2]}, [3, 
4]], $[1], x) \u003d [\"a\",\"x\",{\"b\":[1,2]},[3,4]]\r\n"
        }, {
                "name": "json_arrays([String value1, String value2, ...])\r\n",
                "explanation": "- Return a JSON array string constructed from a 
list of values.\r\n",
                "examples": "JSON_ARRAYS() \u003d []\r\nJSON_ARRAYS(1, 
\u00272\u0027) \u003d [1,\"2\"]\r\nJSON_ARRAYS(JSON_ARRAY(1)) \u003d [[1]]\r\n"
        }, {
                "name": "json_exists(String json_doc, String path)\r\n",
                "explanation": "- Return true if \u0027json_doc\u0027 satisfies 
a given \u0027path\u0027 search criterion;\r\n- Return false otherwise.\r\n",
                "examples": "JSON_EXISTS(\u0027{\"a\": true}\u0027, 
\u0027$.a\u0027) \u003d true\r\nJSON_EXISTS(\u0027{\"a\": true}\u0027, 
\u0027$.b\u0027) \u003d false\r\nJSON_EXISTS(\u0027{\"a\": [{ \"b\": 1 
}]}\u0027, \u0027$.a[0].b\u0027) \u003d true\r\n"
        }, {
                "name": "json_insert(String json_doc, String path1, String 
val1[, String path2, String val2, ...] )\r\n",
                "explanation": "- Return \"\" if any argument is NULL or the 
\u0027json_doc\u0027 argument is not a valid JSON document or any path argument 
is not a valid path expression or contains a * or ** wildcard.;\r\n- Return the 
result of inserting data into \u0027json_doc\u0027.\r\n",
                "examples": "json_insert({\"a\": {\"b\": [1, 2]}, \"c\": [3, 
4]}, $.c[1][1], \"2\", \"$.c[1][1][5]\", \"1\") \u003d 
{\"a\":{\"b\":[1,2]},\"c\":[3,[4,[\"2\",\"1\"]]]}\r\n"
        }, {
                "name": "json_query(String json_doc, String path)\r\n",
                "explanation": "- Return \"\" if any parameter is NULL;\r\n- 
Return the string parsed from the \u0027path\u0027 in 
\u0027json_doc\u0027.\r\n",
                "examples": "json_query({\\\"people\\\": [{\\\"name\\\": 
\\\"Alice\\\"}, {\\\"name\\\": \\\"Bob\\\"}]}, $.people) \u003d 
[{\"name\":\"Alice\"},{\"name\":\"Bob\"}]\r\njson_query({\\\"list\\\": [null, 
{\\\"name\\\": \\\"John\\\"}]}, $.list[1].name) \u003d John\r\n"
        }, {
                "name": "json_quote(String data)\r\njson_string(String 
data)\r\n",
                "explanation": "- Return \"\" if data is NULL;\r\n- Return a 
valid JSON string converted from a string (JSON_QUOTE) or any type of data 
(JSON_STRING).\r\nNote: JSON_QUOTE will escape interior quote and special 
characters (’\"’, ‘\u0027, ‘/’, ‘b’, ‘f’, ’n’, ‘r’, ’t’)\r\n",
                "examples": "json_quote(\u0027Column1\\tColumn2) \u003d 
\\\"Column1\\\\tColumn2\\\"\r\njson_string(true) \u003d \"true\"\r\n"
        }, {
                "name": "json_remove(String json_doc, String path1[, String 
path2, ...])\r\n",
                "explanation": "- Return \"\" if any argument is NULL or the 
\u0027json_doc\u0027 argument is not a valid JSON document or any path argument 
is not a valid path expression or is $ or contains a * or ** wildcard;\r\n- 
Return the result of removing data from \u0027json_doc\u0027.\r\n",
                "examples": 
"json_remove(\"{\\\"name\\\":\\\"Charlie\\\",\\\"hobbies\\\":[[\\\"swimming1\\\",\\\"swimming2\\\"],
 \\\"reading\\\",\\\"coding\\\"]}\",\"$.age\") \u003d 
{\"hobbies\":[[\"swimming2\"],\"coding\"],\"name\":\"Charlie\"}\r\n"
        }, {
                "name": "json_replace(String json_doc, String path1, String 
val1[, String path2, String val2, ...] )\r\n",
                "explanation": "- Return \"\" if any argument is NULL or the 
\u0027json_doc\u0027 argument is not a valid JSON document or any path argument 
is not a valid path expression or contains a * or ** wildcard;\r\n- Return the 
result of replacing existing values in \u0027json_doc\u0027.\r\n",
                "examples": "json_replace(\"{ \\\"a\\\": 1, \\\"b\\\": [2, 
3]}\", \"$.a\", 10, \"$.c\", \"[true, false]\") \u003d {\"a\": 10, \"b\": [2, 
3]}\r\n"
        }, {
                "name": "json_set(String json_doc, String path1, String val1[, 
String path2, String val2, ...] )\r\n",
                "explanation": "- Return \"\" if any argument is NULL or the 
\u0027json_doc\u0027 argument is not a valid JSON document or any path argument 
is not a valid path expression or contains a * or ** wildcard;\r\n- Return the 
result of inserting or updating data in \u0027json_doc\u0027.\r\n",
                "examples": 
"json_set({\\\"name\\\":\\\"Alice\\\"},\"$.name\",\"inlong\") \u003d 
{\"name\":\"inlong\"}\r\n"
        }],
        "total": 12,
        "pageSize": 10,
        "pageNum": 1
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to