array_size function

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime

Returns the number of elements in array.

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