EeshanBembi commented on code in PR #21775:
URL: https://github.com/apache/datafusion/pull/21775#discussion_r3130153185
##########
datafusion/physical-plan/src/joins/stream_join_utils.rs:
##########
@@ -109,6 +109,15 @@ impl JoinHashMapType for PruningJoinHashMap {
fn len(&self) -> usize {
self.map.len()
}
+
+ fn get_first_match(
+ &self,
+ hash_value: u64,
+ predicate: &mut dyn FnMut(u64) -> bool,
+ ) -> Option<u64> {
+ let next: Vec<u64> = self.next.iter().copied().collect();
Review Comment:
Minor: `PruningJoinHashMap::get_first_match` allocates a `Vec<u64>` on every
invocation:
```rust
let next: Vec<u64> = self.next.iter().copied().collect();
get_first_match_impl::<u64>(&self.map, &next, hash_value, predicate)
```
`PruningJoinHashMap` isn't used in the standard `HashJoinStream` path, so
this is fine today. But if this method is ever hot in a symmetric hash join the
allocation will show up. Consider having `get_first_match_impl` accept `&[T]`
(or a generic `impl AsRef<[T]>`) directly — then `SmallJoinHashMap` can pass
`self.next.as_slice()` with zero copy and `PruningJoinHashMap` can do the same
once it stores a plain `Vec<u64>`.
--
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]