diff --git a/Cargo.lock b/Cargo.lock index 8573b585a0..4b10da47cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3170,9 +3170,9 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "permutation" -version = "0.2.5" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9978962f8a4b158e97447a6d09d2d75e206d2994eff056c894019f362b27142" +checksum = "f3f4a387a9ad6165bb590820827ef047d8e2921dfb9821891ed0ef2b7cf82774" [[package]] name = "persistence_windows" diff --git a/read_buffer/Cargo.toml b/read_buffer/Cargo.toml index 8560348e92..d1250b3128 100644 --- a/read_buffer/Cargo.toml +++ b/read_buffer/Cargo.toml @@ -22,7 +22,7 @@ itertools = "0.10.1" metric = { path = "../metric" } observability_deps = { path = "../observability_deps" } parking_lot = "0.12" -permutation = "0.2.5" +permutation = "0.4.0" snafu = "0.7" schema = { path = "../schema" } workspace-hack = { path = "../workspace-hack"} diff --git a/read_buffer/src/row_group.rs b/read_buffer/src/row_group.rs index f9aba5e694..d5104e40bf 100644 --- a/read_buffer/src/row_group.rs +++ b/read_buffer/src/row_group.rs @@ -2333,12 +2333,13 @@ impl<'row_group> ReadAggregateResult<'row_group> { // Now create a permutation by looking at how the row_offsets have been // ordered in the `group_keys` array. - let perm = permutation::Permutation::from_vec( + let perm = permutation::Permutation::oneline( group_keys .iter() .map(|gk| gk.row_offset) .collect::>(), - ); + ) + .inverse(); assert_eq!(perm.len(), self.rows()); // Apply that permutation to all of the columns.