Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
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.
Returns
An ARRAY < STRING >.
If 'jsonObject' is any other valid JSON string, an invalid JSON string or an empty string, the function returns NULL.
Examples
> SELECT json_object_keys('{}');
[]
> SELECT json_object_keys('{"key": "value"}');
[key]
> SELECT json_object_keys('{"f1":"abc","f2":{"f3":"a", "f4":"b"}}');
[f1,f2]