Creates hash values for every row, based on the values in the columns. The number of rows to hash is determined by `hashes_buffer.len()`. `hashes_buffer` should be pre-sized appropriately.
(
arrays: I,
random_state: &RandomState,
hashes_buffer: &'a mut [u64],
)
| 1098 | /// The number of rows to hash is determined by `hashes_buffer.len()`. |
| 1099 | /// `hashes_buffer` should be pre-sized appropriately. |
| 1100 | pub fn create_hashes<'a, I, T>( |
| 1101 | arrays: I, |
| 1102 | random_state: &RandomState, |
| 1103 | hashes_buffer: &'a mut [u64], |
| 1104 | ) -> Result<&'a mut [u64]> |
| 1105 | where |
| 1106 | I: IntoIterator<Item = T>, |
| 1107 | T: AsDynArray, |
| 1108 | { |
| 1109 | for (i, array) in arrays.into_iter().enumerate() { |
| 1110 | // combine hashes with `combine_hashes` for all columns besides the first |
| 1111 | let rehash = i >= 1; |
| 1112 | hash_single_array(array.as_dyn_array(), random_state, hashes_buffer, rehash)?; |
| 1113 | } |
| 1114 | Ok(hashes_buffer) |
| 1115 | } |
| 1116 | |
| 1117 | #[cfg(test)] |
| 1118 | mod tests { |
searching dependent graphs…