Skip to main content
Returns an array by applying <function> on each element of <array>. The Lambda function <function> is a mandatory parameter. Alias: TRANSFORM

Syntax

Parameters

Return Type

ARRAY having the return type of <function> as its element type

Examples

Rows: 1Execution time: 4.89ms

In the example below, the TRANSFORM function is used to CAST each element from a string to a date type. With each element now as a date type, the INTERVAL function is then used to add 5 years to each.

Rows: 1Execution time: 5.62ms

In the example below, ARRAY_TRANSFORM is used with CASE to modify specific elements based on a condition.

Rows: 1Execution time: 5.21ms

This example again uses ARRAY_TRANSFORM with CASE. Elements that don’t meet the condition are left unchanged.

Rows: 1Execution time: 5.32ms

This is another example using CASE that changes elements only if they meet the condition.

Rows: 1Execution time: 5.87ms