Supported in: Batch, Streaming
Unpivot is the opposite operation of pivot. This converts multiple columns into rows, transforming data from a wide format to a long format. To do so it creates two new columns: one containing the original column names as values, and another containing the corresponding data values. All other columns that are not unpivoted are kept as is.
Transform categories: Aggregate, Popular
Type variable bounds: T accepts AnyType
Argument values:
new_york_miles
, london_miles
]Input:
airline | new_york_miles | london_miles |
---|---|---|
foundry airways | 1000 | 6000 |
new air | null | 8000 |
Output:
city | miles | airline |
---|---|---|
new_york_miles | 1000 | foundry airways |
london_miles | 6000 | foundry airways |
new_york_miles | null | new air |
london_miles | 8000 | new air |
Argument values:
new_york_miles
, london_miles
]Input:
airline | new_york_miles | london_miles | miles |
---|---|---|---|
foundry airways | 1000 | 6000 | 0 |
new air | null | 8000 | 0 |
Output:
city | miles | airline |
---|---|---|
new_york_miles | 1000 | foundry airways |
london_miles | 6000 | foundry airways |
new_york_miles | null | new air |
london_miles | 8000 | new air |