|
18 | 18 | use std::cell::RefCell; |
19 | 19 | use std::collections::HashMap; |
20 | 20 | use std::fmt::Debug; |
| 21 | +use std::hash::{DefaultHasher, Hash, Hasher}; |
21 | 22 | use std::sync::Arc; |
22 | 23 |
|
23 | 24 | use arrow::compute::SortOptions; |
@@ -3772,15 +3773,13 @@ impl PhysicalProtoConverterExtension for DeduplicatingSerializer { |
3772 | 3773 | expr: &Arc<dyn PhysicalExpr>, |
3773 | 3774 | codec: &dyn PhysicalExtensionCodec, |
3774 | 3775 | ) -> Result<protobuf::PhysicalExprNode> { |
3775 | | - use std::hash::{Hash, Hasher}; |
3776 | | - |
3777 | 3776 | let mut proto = serialize_physical_expr_with_converter(expr, codec, self)?; |
3778 | 3777 |
|
3779 | 3778 | // Hash session_id, pointer address, and process ID together to create expr_id. |
3780 | 3779 | // - session_id: random per serializer, prevents collisions when merging serializations |
3781 | 3780 | // - ptr: unique address per Arc within a process |
3782 | 3781 | // - pid: prevents collisions if serializer is shared across processes |
3783 | | - let mut hasher = std::collections::hash_map::DefaultHasher::new(); |
| 3782 | + let mut hasher = DefaultHasher::new(); |
3784 | 3783 | self.session_id.hash(&mut hasher); |
3785 | 3784 | (Arc::as_ptr(expr) as *const () as u64).hash(&mut hasher); |
3786 | 3785 | std::process::id().hash(&mut hasher); |
@@ -3834,7 +3833,6 @@ impl PhysicalProtoConverterExtension for DeduplicatingDeserializer { |
3834 | 3833 | if let Some(cached) = self.cache.borrow().get(&expr_id) { |
3835 | 3834 | return Ok(Arc::clone(cached)); |
3836 | 3835 | } |
3837 | | - |
3838 | 3836 | // Deserialize and cache |
3839 | 3837 | let expr = parse_physical_expr_with_converter( |
3840 | 3838 | proto, |
|
0 commit comments