alamb commented on code in PR #26159:
URL: https://github.com/apache/datafusion/pull/26159#discussion_r4242814058


##########
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) };

Review Comment:
   the safety is predicated o the fact that the key came from a valid Arrow 
array and thus is guaranteed to be in bound of the dictionary



-- 
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]

Reply via email to