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

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

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


##########
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:
   Thanks @Dandandan for pointing it out. You are right. It's my bad. The RawTable utilizes the open addressing policy for looking for matched entries. I'll revert this commit.



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