Skip to content

Commit

Permalink
Minor: Add one more assert to hash_array_primitive
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Jul 3, 2023
1 parent 59d1b81 commit 0b8df7e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions datafusion/physical-expr/src/hash_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ fn hash_array_primitive<T>(
T: ArrowPrimitiveType,
<T as arrow_array::ArrowPrimitiveType>::Native: HashValue,
{
assert_eq!(
hashes_buffer.len(),
array.len(),
"hashes_buffer and array should be of equal length"
);

if array.null_count() == 0 {
if rehash {
for (hash, &value) in hashes_buffer.iter_mut().zip(array.values().iter()) {
Expand Down

0 comments on commit 0b8df7e

Please sign in to comment.