Weijun-H commented on code in PR #8552:
URL: https://github.com/apache/arrow-datafusion/pull/8552#discussion_r1427771720
##########
datafusion/common/src/hash_utils.rs:
##########
@@ -207,6 +208,37 @@ fn hash_dictionary<K: ArrowDictionaryKeyType>(
Ok(())
}
+fn hash_struct_array(
+ array: &StructArray,
+
+ random_state: &RandomState,
+ hashes_buffer: &mut [u64],
+) -> Result<()> {
+ let values = array.columns();
+ let nulls = array.nulls();
+ let num_columns = values.len();
+
+ // Skip null columns
+ let valid_indices: Vec<usize> = if let Some(nulls) = nulls {
+ nulls.valid_indices().collect()
+ } else {
+ (0..num_columns).collect()
+ };
+
+ for i in valid_indices {
+ let mut values_hashes = vec![0u64; array.len()];
Review Comment:
Why do you create a new vec for each iteration?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]