Skip to main content
Scalar function
NULL array returns NULL; NULL elements are passed to the lambda. NULL lambda results become NULL elements.

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.
  • U is the result type of the lambda or finish expression: BOOLEAN, TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE, DECIMAL(p, s), STRING, BINARY, DATE, TIME, TIMESTAMP, ARRAY, MAP or STRUCT.

Returns

  • Type: ARRAY<U>
  • Possible values: The lambda results.
  • NULL behavior: NULL array returns NULL; NULL elements are passed to the lambda. NULL lambda results become NULL elements.
  • Shape: Same number of elements as input.
  • Ordering: Input encounter order.

Properties

Usage notes

  • The optional lambda index is zero-based.
  • 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

Transform strings

Limitations

  • The same input gives repeatable results only when the supplied lambda does. Avoid random or other changing expressions when you need reproducible results.
Last modified on October 15, 2026