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

Function hash_fixed_list_array

datafusion/common/src/hash_utils.rs:841–871  ·  view source on GitHub ↗
(
    array: &FixedSizeListArray,
    random_state: &RandomState,
    hashes_buffer: &mut [u64],
)

Source from the content-addressed store, hash-verified

839
840#[cfg(not(feature = "force_hash_collisions"))]
841fn hash_fixed_list_array(
842 array: &FixedSizeListArray,
843 random_state: &RandomState,
844 hashes_buffer: &mut [u64],
845) -> Result<()> {
846 let values = array.values();
847 let value_length = array.value_length() as usize;
848 let nulls = array.nulls();
849 let mut values_hashes = vec![0u64; values.len()];
850 create_hashes([values], random_state, &mut values_hashes)?;
851 if let Some(nulls) = nulls {
852 for i in 0..array.len() {
853 if nulls.is_valid(i) {
854 let hash = &mut hashes_buffer[i];
855 for values_hash in
856 &values_hashes[i * value_length..(i + 1) * value_length]
857 {
858 *hash = combine_hashes(*hash, *values_hash);
859 }
860 }
861 }
862 } else {
863 for i in 0..array.len() {
864 let hash = &mut hashes_buffer[i];
865 for values_hash in &values_hashes[i * value_length..(i + 1) * value_length] {
866 *hash = combine_hashes(*hash, *values_hash);
867 }
868 }
869 }
870 Ok(())
871}
872
873/// Inner hash function for RunArray
874#[inline(never)]

Callers

nothing calls this directly

Calls 6

create_hashesFunction · 0.85
combine_hashesFunction · 0.85
valuesMethod · 0.45
nullsMethod · 0.45
lenMethod · 0.45
is_validMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…