raminqaf commented on code in PR #29617:
URL: https://github.com/apache/flink/pull/29617#discussion_r4401616948
##########
flink-table/flink-table-runtime/src/test/java/org/apache/flink/table/runtime/functions/scalar/SimplePathJaywayConformanceTest.java:
##########
Review Comment:
Removed
##########
docs/content.zh/docs/sql/functions/built-in-functions.md:
##########
@@ -233,6 +233,35 @@ A document fails to parse if it:
In all of these cases, `TRY_PARSE_XML` returns `NULL`.
+#### Variant paths
+
+`VARIANT_GET` and `TRY_VARIANT_GET` take a path that names one place in a
Variant. A path starts
+with `$`, the whole value, followed by steps: `.name`, `['name']` or
`["name"]` for a field, and
+`[n]` for an array element. For example, on
+`PARSE_JSON('{"user": {"name": "ada"}, "items": [{"qty": 2}]}')`:
+
+| Path | Points at |
+|---------------------|------------------------------------|
+| `$` | the whole value |
+| `$.user.name` | `"ada"` |
+| `$['user']["name"]` | `"ada"` |
+| `$.items[0].qty` | `2` |
+| `$.items[1]` | nothing, the index is past the end |
+| `$.user[0]` | nothing, `user` is not an array |
+
+- Array indices start at 0, as in `JSON_VALUE`, while `variant[INT]` starts at
1. So `$.items[0]`
+ and `v['items'][1]` are the same element.
Review Comment:
Done
--
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]