Events
Mar 31, 11 PM - Apr 2, 11 PM
The ultimate Microsoft Fabric, Power BI, SQL, and AI community-led event. March 31 to April 2, 2025.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
transform
functionApplies to: Databricks SQL Databricks Runtime
Transforms elements in an array in expr
using the function func
.
transform(expr, func)
expr
: An ARRAY expression.func
: A lambda function.An ARRAY of the type of the lambda function’s result.
The lambda function must have 1 or 2 parameters. The first parameter represents the element, the optional second parameter represents the index of the element.
The lambda function produces a new value for each element in the array.
> SELECT transform(array(1, 2, 3), x -> x + 1);
[2,3,4]
> SELECT transform(array(1, 2, 3), (x, i) -> x + i);
[1,3,5]
Events
Mar 31, 11 PM - Apr 2, 11 PM
The ultimate Microsoft Fabric, Power BI, SQL, and AI community-led event. March 31 to April 2, 2025.
Register todayTraining
Module
Transform data with Spark in Azure Synapse Analytics - Training
Learn how to use Apache Spark pools in Azure Synapse Analytics to transform data.