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
### `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 |
+-----------+-----------+-------------+
Is your feature request related to a problem?
As part of the RFC to add JSON functions, the
json_array
function would be useful to construct json objects with arrays.JSON
extended functions support #3027JSON
extended functions support #3028What solution would you like?
What alternatives have you considered?
N/A
Do you have any additional context?
opensearch-project/opensearch-spark#870 - PR to add feature to opensearch-spark PPL
The text was updated successfully, but these errors were encountered: