Concretely, this PR adds a new cell type "Pivot" that allows users to migrate row values into columns.
In addition to input and output datasets, The pivot cell takes three parameters:
A target column
A set of value columns
A set of key columns (optional)
One copy of each value column will be created for every distinct value in the target column, and its value in a given row will be taken from the row where the value column has that value. If key columns are provided, they act like group-by attributes (i.e., one row per group-by)
If multiple rows can be used to populate a given cell AND those rows contain multiple distinct values, the resulting cell will be caveated and an arbitrary (first) value will be selected. If a particular cell has no candidate rows, the cell will be null and caveated.
This PR is the other half of https://github.com/UBOdin/mimir-api/pull/6 , which is needed to implement https://github.com/VizierDB/web-ui/issues/101
Concretely, this PR adds a new cell type "Pivot" that allows users to migrate row values into columns.
In addition to input and output datasets, The pivot cell takes three parameters:
One copy of each value column will be created for every distinct value in the target column, and its value in a given row will be taken from the row where the value column has that value. If key columns are provided, they act like group-by attributes (i.e., one row per group-by)
If multiple rows can be used to populate a given cell AND those rows contain multiple distinct values, the resulting cell will be caveated and an arbitrary (
first
) value will be selected. If a particular cell has no candidate rows, the cell will be null and caveated.