array_length

Description

returns the number of elements in an array, or null if input is not an array

Return type

int64

Domain

This is a scalar function (calculates a single output value for a single input row.)

Categories

Usage

array_length(array)

Argument

Type

Optional

Repeatable

Restrictions

array

array

no

no

none

Examples

make_col elements:split(proxy_upstream_name, "-")
make_col elementsLength:array_length(elements)

This produces an elementsLength column with the number of elements in each array produced by splitting a column named proxy_upstream_name on the “-” character. A proxy_upstream_name of “upstream-default-backend” produces an elementsLength of “3”.