MCPcopy Create free account
hub / github.com/apache/datafusion / create_hashes

Function create_hashes

datafusion/common/src/hash_utils.rs:1100–1115  ·  view source on GitHub ↗

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],
)

Source from the content-addressed store, hash-verified

1098/// The number of rows to hash is determined by `hashes_buffer.len()`.
1099/// `hashes_buffer` should be pre-sized appropriately.
1100pub fn create_hashes<'a, I, T>(
1101 arrays: I,
1102 random_state: &RandomState,
1103 hashes_buffer: &'a mut [u64],
1104) -> Result<&'a mut [u64]>
1105where
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)]
1118mod tests {

Callers 15

internMethod · 0.85
scalarized_internMethod · 0.85
vectorized_internMethod · 0.85
partition_iterMethod · 0.85
update_hashFunction · 0.85
lookup_join_hashmapFunction · 0.85
fetch_probe_batchMethod · 0.85
evaluateMethod · 0.85
with_hashesFunction · 0.85

Calls 3

hash_single_arrayFunction · 0.85
as_dyn_arrayMethod · 0.80
into_iterMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…