pub fn permutation_for_arrangement(
key: &[impl Columns],
unthinned_arity: usize,
) -> (Vec<usize>, Vec<usize>)Expand description
Derive supporting logic to support transforming rows to (key, val) pairs, and back again.
We are given as input a list of mappings from columns to key indices, a key length, and an input arity. (The produced key should be the application of the key expressions.)
To produce the val output, we will identify those input columns not found in
the key expressions, and name all other columns.
To reconstitute the original row, we identify the sequence of columns from the
concatenation of key and val which would reconstruct the original row.
The output is a pair of column sequences, the first used to reconstruct a row from the concatenation of key and value, and the second to identify the columns of a row that should become the value associated with its key.
The permutations and thinning expressions generated here will be tracked in
compute_types::plan::AvailableCollections; see the
documentation there for more details.