<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
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
ARRAY_TRANSFORM is used with CASE to modify specific elements based on a condition.
Rows: 1Execution time: 5.21ms
ARRAY_TRANSFORM with CASE. Elements that don’t meet the condition are left unchanged.
Rows: 1Execution time: 5.32ms
CASE that changes elements only if they meet the condition.
Rows: 1Execution time: 5.87ms