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

Function hash_list_view_array

datafusion/common/src/hash_utils.rs:674–710  ·  view source on GitHub ↗
(
    array: &GenericListViewArray<OffsetSize>,
    random_state: &RandomState,
    hashes_buffer: &mut [u64],
)

Source from the content-addressed store, hash-verified

672
673#[cfg(not(feature = "force_hash_collisions"))]
674fn hash_list_view_array<OffsetSize>(
675 array: &GenericListViewArray<OffsetSize>,
676 random_state: &RandomState,
677 hashes_buffer: &mut [u64],
678) -> Result<()>
679where
680 OffsetSize: OffsetSizeTrait,
681{
682 let values = array.values();
683 let offsets = array.value_offsets();
684 let sizes = array.value_sizes();
685 let nulls = array.nulls();
686 let mut values_hashes = vec![0u64; values.len()];
687 create_hashes([values], random_state, &mut values_hashes)?;
688 if let Some(nulls) = nulls {
689 for (i, (offset, size)) in offsets.iter().zip(sizes.iter()).enumerate() {
690 if nulls.is_valid(i) {
691 let hash = &mut hashes_buffer[i];
692 let start = offset.as_usize();
693 let end = start + size.as_usize();
694 for values_hash in &values_hashes[start..end] {
695 *hash = combine_hashes(*hash, *values_hash);
696 }
697 }
698 }
699 } else {
700 for (i, (offset, size)) in offsets.iter().zip(sizes.iter()).enumerate() {
701 let hash = &mut hashes_buffer[i];
702 let start = offset.as_usize();
703 let end = start + size.as_usize();
704 for values_hash in &values_hashes[start..end] {
705 *hash = combine_hashes(*hash, *values_hash);
706 }
707 }
708 }
709 Ok(())
710}
711
712#[cfg(not(feature = "force_hash_collisions"))]
713fn hash_union_array(

Callers

nothing calls this directly

Calls 8

create_hashesFunction · 0.85
combine_hashesFunction · 0.85
value_offsetsMethod · 0.80
valuesMethod · 0.45
nullsMethod · 0.45
iterMethod · 0.45
is_validMethod · 0.45
as_usizeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…