[ https://issues.apache.org/jira/browse/CALCITE-2892?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hongze Zhang resolved CALCITE-2892. ----------------------------------- Resolution: Fixed Fixed in [80dc5bcb3efa9c72573c4cc5b02f512d34c20d13|https://gitbox.apache.org/repos/asf?p=calcite.git;a=commit;h=80dc5bcb3efa9c72573c4cc5b02f512d34c20d13]. Thanks, [~x1q1j1]! > Add the JSON_KEYS function > -------------------------- > > Key: CALCITE-2892 > URL: https://issues.apache.org/jira/browse/CALCITE-2892 > Project: Calcite > Issue Type: Sub-task > Reporter: Forward Xu > Assignee: Forward Xu > Priority: Major > Labels: pull-request-available > Fix For: 1.20.0 > > Time Spent: 3h > Remaining Estimate: 0h > > [{{JSON_KEYS(_{{json_doc}}_[, > _{{path}}_])}}|https://dev.mysql.com/doc/refman/5.7/en/json-search-functions.html#function_json-keys] > Returns the keys from the top-level value of a JSON object as a JSON array, > or, if a _{{path}}_ argument is given, the top-level keys from the selected > path. Returns {{NULL}} if any argument is {{NULL}}, the _{{json_doc}}_ > argument is not an object, or _{{path}}_, if given, does not locate an > object. An error occurs if the _{{json_doc}}_argument is not a valid JSON > document or the _{{path}}_ argument is not a valid path expression or > contains a {{*}} or {{**}} wildcard. > The result array is empty if the selected object is empty. If the top-level > value has nested subobjects, the return value does not include keys from > those subobjects. > Example SQL: > {code:java} > // code placeholder > SELECT JSON_KEYS(v) AS c1 > ,JSON_KEYS(v, 'lax $.a') AS c2 > ,JSON_KEYS(v, '$.b') AS c3 > ,JSON_KEYS(v, 'strict $.a[0]') AS c4 > ,JSON_KEYS(v, 'strict $.a[1]') AS c5 > FROM (VALUES ('{"a": [10, true],"b": {"c": 30}}')) AS t(v) > LIMIT 10; > {code} > Result: > ||c1||c2||c3||c4||c5|| > |["a", "b"]|[NULL]|["c"]|[NULL]|[NULL]| -- This message was sent by Atlassian JIRA (v7.6.3#76005)