Dandandan commented on a change in pull request #9116:
URL: https://github.com/apache/arrow/pull/9116#discussion_r554979135



##########
File path: rust/datafusion/src/physical_plan/hash_join.rs
##########
@@ -269,34 +276,35 @@ impl ExecutionPlan for HashJoinExec {
             num_output_batches: 0,
             num_output_rows: 0,
             join_time: 0,
+            random_state: self.random_state.clone(),
         }))
     }
 }
 
 /// Updates `hash` with new entries from [RecordBatch] evaluated against the 
expressions `on`,
 /// assuming that the [RecordBatch] corresponds to the `index`th
 fn update_hash(
-    on: &HashSet<String>,
+    on: &[String],
     batch: &RecordBatch,
     hash: &mut JoinHashMap,
     offset: usize,
+    random_state: &RandomState,
 ) -> Result<()> {
     // evaluate the keys
     let keys_values = on
         .iter()
         .map(|name| 
Ok(col(name).evaluate(batch)?.into_array(batch.num_rows())))
         .collect::<Result<Vec<_>>>()?;
 
-    let mut key = Vec::with_capacity(keys_values.len());
-
     // update the hash map
-    for row in 0..batch.num_rows() {
-        create_key(&keys_values, row, &mut key)?;
+    let hash_values = create_hashes(&keys_values, &random_state)?;
 
+    // insert hashes to key of the hashmap
+    for (row, hash_value) in hash_values.iter().enumerate() {
         hash.raw_entry_mut()
-            .from_key(&key)
+            .from_key_hashed_nocheck(*hash_value, hash_value)

Review comment:
       hash = key now




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to