This is an automated email from the ASF dual-hosted git repository.
Rachelint pushed a commit to branch improve-compare-in-view-map
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/improve-compare-in-view-map by
this push:
new 9cf67737b0 Reuse byte view hash for input cache
9cf67737b0 is described below
commit 9cf67737b00faa34de3dd75f2d8f1002fde04fc1
Author: kamille <[email protected]>
AuthorDate: Thu Jul 9 07:43:11 2026 +0800
Reuse byte view hash for input cache
---
datafusion/physical-expr-common/src/binary_view_map.rs | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/datafusion/physical-expr-common/src/binary_view_map.rs
b/datafusion/physical-expr-common/src/binary_view_map.rs
index c6b533b454..7d954b5cc2 100644
--- a/datafusion/physical-expr-common/src/binary_view_map.rs
+++ b/datafusion/physical-expr-common/src/binary_view_map.rs
@@ -305,7 +305,10 @@ where
let cached_payload = if input_has_buffers && len > 12 {
num_cache_lookups += 1;
- self.input_view_to_payload.get(&view_u128).copied()
+ self.input_view_to_payload
+ .raw_entry()
+ .from_hash(hash, |cached_view| *cached_view == view_u128)
+ .map(|(_, payload)| *payload)
} else {
None
};
@@ -350,8 +353,17 @@ where
let payload = if let Some(payload) = maybe_payload {
if input_has_buffers && len > 12 {
- self.input_view_to_payload.insert(view_u128, payload);
- num_cache_inserts += 1;
+ match self
+ .input_view_to_payload
+ .raw_entry_mut()
+ .from_hash(hash, |cached_view| *cached_view ==
view_u128)
+ {
+ hashbrown::hash_map::RawEntryMut::Occupied(_) => {}
+ hashbrown::hash_map::RawEntryMut::Vacant(entry) => {
+ entry.insert_hashed_nocheck(hash, view_u128,
payload);
+ num_cache_inserts += 1;
+ }
+ }
}
payload
} else {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]