VizierDB / web-api-async

Vizier Asynchronous Web API
Apache License 2.0
2 stars 2 forks source link

Pivot lens #81

Closed okennedy closed 4 years ago

okennedy commented 4 years ago

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.

image

In addition to input and output datasets, The pivot cell takes three parameters:

  1. A target column
  2. A set of value columns
  3. 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.

okennedy commented 4 years ago

Addendum to the last push: This PR also addresses https://github.com/VizierDB/web-ui/issues/223