alamb commented on code in PR #26159:
URL: https://github.com/apache/datafusion/pull/26159#discussion_r4242819111
##########
datafusion/common/src/hash_utils.rs:
##########
@@ -543,23 +555,17 @@ fn hash_dictionary_scatter<
if let Some(key) = key {
let idx = key.as_usize();
if !HAS_NULL_VALUES || dict_values.is_valid(idx) {
- if MULTI_COL {
- *hash = combine_hashes(dict_hashes[idx], *hash);
- } else {
- *hash = dict_hashes[idx];
- }
+ let dict_hash = unsafe { *dict_hashes.get_unchecked(idx) };
+ *hash = maybe_combine_dict_hash::<MULTI_COL>(*hash,
dict_hash);
}
}
}
} else {
for (hash, key) in hashes_buffer.iter_mut().zip(array.keys().values())
{
let idx = key.as_usize();
if !HAS_NULL_VALUES || dict_values.is_valid(idx) {
- if MULTI_COL {
- *hash = combine_hashes(dict_hashes[idx], *hash);
- } else {
- *hash = dict_hashes[idx];
- }
+ let dict_hash = unsafe { *dict_hashes.get_unchecked(idx) };
+ *hash = maybe_combine_dict_hash::<MULTI_COL>(*hash, dict_hash);
Review Comment:
you could probably shrink the diff by not pulling the function out and
leaving it inlined
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]