Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: Databricks SQL
Databricks Runtime
Returns the number of elements in the outermost JSON array.
jsonArray
: A JSON array.
An INTEGER.
The function returns NULL if jsonArray
is not a valid JSON string or NULL
.
> SELECT json_array_length('[1,2,3,4]');
4
> SELECT json_array_length('[1,2,3,{"f1":1,"f2":[5,6]},4]');
5
> SELECT json_array_length('[1,2');
NULL