Skip to main content
Scalar function
Returns NULL for a NULL array. NULL elements are removed.

Syntax

Scalar

Arguments

Type notation used below:
  • T is the array element type: BOOLEAN, TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE, DECIMAL(p, s), STRING, BINARY, DATE, TIME, TIMESTAMP, ARRAY, MAP or STRUCT.

Returns

  • Type: ARRAY<T>
  • Possible values: The retained elements, including duplicates.
  • NULL behavior: Returns NULL for a NULL array. NULL elements are removed.
  • Shape: Zero through the original number of elements.
  • Ordering: Original encounter order.

Properties

Usage notes

  • 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

Keep non-NULL strings

Last modified on October 15, 2026