Turns several columns into rows, with one column carrying the former column names and value columns carrying their data; it is the opposite of PIVOT and needs Databricks Runtime 12.2 LTS or later.
Read more: Microsoft Learn
In the Ultra Transcenders books
Each book explains UNPIVOT in context, with comparison tables and the common traps.
Terms in this definition
- PIVOT
A SQL clause that turns each distinct value of a column into its own column, aggregating the data along the way.
UNPIVOTreverses it. - Databricks Runtime
The software image, Apache Spark among its core parts, that Azure Databricks installs on compute. Long-term support (LTS) releases are the advised choice when job compute runs production work.
- LTS
Applies to some Databricks Runtime versions, which Learn recommends for job compute in production. Feature work on such a version stops after about six months, and for three years afterwards it gets security and stability fixes backported.
Related terms
- Pivot column
A Power Query transform that creates a new column for every distinct value in a column and fills it by aggregating a chosen value column, with Sum as the default or no aggregation. Unpivot reverses it.