Skip to content

Commit

Permalink
update doctest
Browse files Browse the repository at this point in the history
Signed-off-by: Kenrick Yap <[email protected]>
  • Loading branch information
kenrickyap committed Jan 23, 2025
1 parent 794db8a commit 0f0b8d4
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions docs/user/ppl/functions/json.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,17 @@ Return type: BOOLEAN/DOUBLE/INTEGER/NULL/STRUCT/ARRAY
Example::

> source=json_test | where json_valid(json_string) | eval json=json(json_string) | fields test_name, json_string, json
fetched rows / total rows = 4/4
+---------------------+------------------------------+---------------+
| test_name | json_string | json |
|---------------------|------------------------------|---------------|
| json object | {"a":"1","b":"2"} | {a:"1",b:"2"} |
| json array | [1, 2, 3, 4] | [1,2,3,4] |
| json scalar string | "abc" | "abc" |
| json empty string | | null |
+---------------------+------------------------------+---------------+
fetched rows / total rows = 6/6
+---------------------+-------------------------------------+-----------------------------+
| test_name | json_string | json |
|---------------------|-------------------------------------|-----------------------------|
| json nested object | {"a":"1","b":{"c":"2","d":"3"}} | {a:"1",b:{c:"2",d:"3"} |
| json nested list | {"a":"1","b":[{"c":"2"},{"c":"3"}]} | {a:"1",b:[{c:"2"},{c:"3"}]} |
| json object | {"a":"1","b":"2"} | {a:"1",b:"2"} |
| json array | [1, 2, 3, 4] | [1,2,3,4] |
| json scalar string | "abc" | "abc" |
| json empty string | | null |
+---------------------+-------------------------------------+-----------------------------+

JSON_EXTRACT
____________
Expand Down

0 comments on commit 0f0b8d4

Please sign in to comment.