You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by al...@apache.org on 2023/07/03 20:38:12 UTC
[arrow-datafusion] branch main updated: Minor: Add one more assert to `hash_array_primitive` (#6834)
This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 4ff0a8ede5 Minor: Add one more assert to `hash_array_primitive` (#6834)
4ff0a8ede5 is described below
commit 4ff0a8ede5c853fcbc2b7cac078bb1a6fce87df6
Author: Andrew Lamb <an...@nerdnetworks.org>
AuthorDate: Mon Jul 3 16:38:06 2023 -0400
Minor: Add one more assert to `hash_array_primitive` (#6834)
---
datafusion/physical-expr/src/hash_utils.rs | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/datafusion/physical-expr/src/hash_utils.rs b/datafusion/physical-expr/src/hash_utils.rs
index 44699285a9..cf0a3f5eab 100644
--- a/datafusion/physical-expr/src/hash_utils.rs
+++ b/datafusion/physical-expr/src/hash_utils.rs
@@ -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()) {