You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "Dandandan (via GitHub)" <gi...@apache.org> on 2023/04/10 18:54:28 UTC

[GitHub] [arrow-datafusion] Dandandan commented on a diff in pull request #5941: Remove unnecessary equality check for JoinHashMap - Issue 5940

Dandandan commented on code in PR #5941:
URL: https://github.com/apache/arrow-datafusion/pull/5941#discussion_r1161987716


##########
datafusion/core/src/physical_plan/joins/hash_join.rs:
##########
@@ -594,16 +593,17 @@ pub fn update_hash(
     let hash_values = create_hashes(&keys_values, random_state, hashes_buffer)?;
 
     // insert hashes to key of the hashmap
-    for (row, hash_value) in hash_values.iter().enumerate() {
-        let item = hash_map
-            .0
-            .get_mut(*hash_value, |(hash, _)| *hash_value == *hash);
+    let row_start = offset;
+    let row_end = offset + hash_values.len();
+    for (row, hash_value) in (row_start..row_end).zip(hash_values.iter()) {
+        // the hash value is the key, always true
+        let item = hash_map.0.get_mut(*hash_value, |_| true);

Review Comment:
   The equality check might still be necessary.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org