writer-jill commented on code in PR #17635:
URL: https://github.com/apache/druid/pull/17635#discussion_r1932299212
##########
docs/querying/sql-functions.md:
##########
@@ -2787,70 +2787,222 @@ Returns the following:
## JSON_KEYS
-Returns an array of field names from `expr` at the specified `path`.
+Returns an array of field names from an expression, at a specified path.
-* **Syntax**: `JSON_KEYS(expr, path)`
+* **Syntax:** `JSON_KEYS(expr, path)`
* **Function type:** JSON
-[Learn more](sql-json-functions.md)
+<details><summary>Example</summary>
+
+The following example returns an array of field names from the nested column
`agent`:
+
+```sql
+SELECT
+ JSON_KEYS(agent, '$.') AS agent_keys
+FROM "kttm_nested"
+LIMIT 1
+```
+
+Returns the following:
+| `agent_keys` |
+| -- |
+| `[type, category, browser, browser_version, os, platform]` |
+
+</details>
+
+[Learn more](sql-json-functions.md)
## JSON_MERGE
-Merges two or more JSON `STRING` or `COMPLEX<json>` into one. Preserves the
rightmost value when there are key overlaps. Returning always a `COMPLEX<json>`
type.
+Merges two or more JSON `STRING` or `COMPLEX<json>` expressions into one,
preserving the rightmost value when there are key overlaps.
+The function always returns a `COMPLEX<json>` object.
* **Syntax:** `JSON_MERGE(expr1, expr2[, expr3 ...])`
* **Function type:** JSON
-[Learn more](sql-json-functions.md)
+<details><summary>Example</summary>
+
+The following example merges the `event` object with a static string
`example_string`:
+
+```sql
+SELECT
+ event,
+ JSON_MERGE(event, '{"example_string": 123}') as eventAndstring
Review Comment:
updated
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]