You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] Add json_array_length function to PPL #3218
### `JSON_ARRAY_LENGTH`
**Description**
`json_array_length(doc[, path])` Returns the number of elements in array at path in the JSON document. By default, path is the root of the document. Returns NULL if the element at path is not an array.
**Argument type:** JSON_OBJECT, STRING
**Return type:** INTEGER | NULL
Example:
os> source=people | eval `length1` = json_array_length(json('[1,2,3,4]'), '{}'), `length2` = json_array_length(json('[1,2,3,{"f1":1,"f2":[5,6]},4]', '{}[3].f2'), `not_array` = json_array_length(json('{"key": 1}', '{}')
fetched rows / total rows = 1/1
+-----------+-----------+-------------+
| lenght1 | lenght2 | not_array |
+-----------+-----------+-------------+
| 4 | 2 | null |
+-----------+-----------+-------------+
Activity
[-][FEATURE] Add json_array_length function to PPL[/-][+][FEATURE] Add `json_array_length` function to PPL[/+]LantaoJin commentedon Jun 16, 2025
Resolved by #3559 with Calcite implementation.