(
array: &StructArray,
random_state: &RandomState,
hashes_buffer: &mut [u64],
)
| 540 | |
| 541 | #[cfg(not(feature = "force_hash_collisions"))] |
| 542 | fn hash_struct_array( |
| 543 | array: &StructArray, |
| 544 | random_state: &RandomState, |
| 545 | hashes_buffer: &mut [u64], |
| 546 | ) -> Result<()> { |
| 547 | let nulls = array.nulls(); |
| 548 | let row_len = array.len(); |
| 549 | |
| 550 | // Create hashes for each row that combines the hashes over all the column at that row. |
| 551 | let mut values_hashes = vec![0u64; row_len]; |
| 552 | create_hashes(array.columns(), random_state, &mut values_hashes)?; |
| 553 | |
| 554 | // Separate paths to avoid allocating Vec when there are no nulls |
| 555 | if let Some(nulls) = nulls { |
| 556 | for i in nulls.valid_indices() { |
| 557 | let hash = &mut hashes_buffer[i]; |
| 558 | *hash = combine_hashes(*hash, values_hashes[i]); |
| 559 | } |
| 560 | } else { |
| 561 | for i in 0..row_len { |
| 562 | let hash = &mut hashes_buffer[i]; |
| 563 | *hash = combine_hashes(*hash, values_hashes[i]); |
| 564 | } |
| 565 | } |
| 566 | |
| 567 | Ok(()) |
| 568 | } |
| 569 | |
| 570 | // only adding this `cfg` b/c this function is only used with this `cfg` |
| 571 | #[cfg(not(feature = "force_hash_collisions"))] |
nothing calls this directly
no test coverage detected
searching dependent graphs…