Skip to content

Commit

Permalink
[FLINK-37175][docs] Complement documentation for json function
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavodemorais authored and dawidwys committed Feb 3, 2025
1 parent 2a3de2b commit 64bff89
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/data/sql_functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1086,8 +1086,8 @@ json:
This function can currently only be used within the `JSON_OBJECT` function. It allows passing
pre-formatted JSON strings that will be inserted directly into the resulting JSON structure
rather than being escaped as a string value. This allows storing nested JSON structures in a
JSON_OBJECT without processing them as strings. If the value is NULL or empty, the function
returns NULL.
JSON_OBJECT without processing them as strings, which is often useful when ingesting already
formatted json data. If the value is NULL or empty, the function returns NULL.
```sql
-- {"K":{"K2":42}}
Expand Down
3 changes: 2 additions & 1 deletion flink-python/pyflink/table/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,8 @@ def json(value) -> Expression:
This function can currently only be used within the `JSON_OBJECT` function. It allows passing
pre-formatted JSON strings that will be inserted directly into the resulting JSON structure
rather than being escaped as a string value. This allows storing nested JSON structures in a
JSON_OBJECT without processing them as strings. If the value is NULL or empty, the function
JSON_OBJECT without processing them as strings, which is often useful when ingesting already
formatted json data. If the value is NULL or empty, the function
returns NULL.
Examples:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -885,8 +885,9 @@ public static ApiExpression jsonObject(JsonOnNull onNull, Object... keyValues) {
* <p>This function can currently only be used within the {@link #jsonObject(JsonOnNull,
* Object...)} function. It allows passing pre-formatted JSON strings that will be inserted
* directly into the resulting JSON structure rather than being escaped as a string value. This
* allows storing nested JSON structures in a JSON_OBJECT without processing them as strings. If
* the value is null or empty, the function returns {@code null}.
* allows storing nested JSON structures in a JSON_OBJECT without processing them as strings,
* which is often useful when ingesting already formatted json data. If the value is null or
* empty, the function returns {@code null}.
*
* <p>Examples:
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,6 @@ private static List<TestSetSpec> jsonStringSpec() {
STRING().notNull()));
}

// Test with alias?? using str$1
private static List<TestSetSpec> jsonSpec() {
return Arrays.asList(
TestSetSpec.forFunction(BuiltInFunctionDefinitions.JSON_OBJECT)
Expand Down

0 comments on commit 64bff89

Please sign in to comment.