Skip to main content
Scalar function
Returns NULL for a NULL collection.

Syntax

Scalar

Arguments

Returns

  • Type: unsigned 64-bit integer; query tools may report INTEGER
  • Possible values: A nonnegative count; zero for an empty collection.
  • NULL behavior: Returns NULL for a NULL collection.

Properties

Usage notes

  • NULL elements count toward array size.
  • INTEGER and INT mean the same type; STRING means VARCHAR text. NULL can be used with a supported type. Cast NULL explicitly when its type would otherwise be unclear.

Examples

Typical behavior

Count strings including NULL

Limitations

  • The size is returned as an unsigned 64-bit integer, even when query tools report INTEGER. Some nonstandard array storage formats can raise an error.
Last modified on October 15, 2026