json_object_keys
function
Applies to: Databricks SQL Databricks Runtime
Returns all the keys of the outermost JSON object as an array.
Syntaxâjson_object_keys(jsonObject)
Argumentsâ
jsonObject
: A STRING expression of a valid JSON array format.An ARRAY < STRING >.
If 'jsonObject' is any other valid JSON string, an invalid JSON string or an empty string, the function returns NULL.
ExamplesâSQL
> SELECT json_object_keys('{}');
[]
> SELECT json_object_keys('{"key": "value"}');
[key]
> SELECT json_object_keys('{"f1":"abc","f2":{"f3":"a", "f4":"b"}}');
[f1,f2]
Related functionsâ
json_array_length
functionjson_tuple
table-valued generator functionfrom_json
functionget_json_object
functionschema_of_json
functionto_json
functionRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4