array_size function

Returns the number of elements in array.

Since: Databricks Runtime 10.5

Syntax

array_size(array)

Arguments

  • array: An ARRAY expression.

Returns

An INTEGER.

Examples

> SELECT array_size(array(1, NULL, 3, NULL));
  4

> SELECT array_size(array());
  0