From 1f8e1f1cdd080c375d5596e21afe02270849fb19 Mon Sep 17 00:00:00 2001 From: "Jorge C. Leitao" Date: Wed, 12 Oct 2022 05:27:14 +0000 Subject: [PATCH] Fixed hash --- src/compute/hash.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/compute/hash.rs b/src/compute/hash.rs index 3387ac9bbd7..68232b4d015 100644 --- a/src/compute/hash.rs +++ b/src/compute/hash.rs @@ -1,7 +1,7 @@ //! Contains the [`hash`] and typed (e.g. [`hash_primitive`]) operators. // multiversion does not copy documentation, causing a false positive #![allow(missing_docs)] -use ahash::{CallHasher, RandomState}; +use ahash::RandomState; use multiversion::multiversion; use std::hash::Hash; @@ -26,7 +26,7 @@ use super::arity::unary; pub fn hash_primitive(array: &PrimitiveArray) -> PrimitiveArray { let state = new_state!(); - unary(array, |x| T::get_hash(&x, &state), DataType::UInt64) + unary(array, |x| state.hash_one(x), DataType::UInt64) } #[multiversion] @@ -37,7 +37,7 @@ pub fn hash_boolean(array: &BooleanArray) -> PrimitiveArray { let values = array .values_iter() - .map(|x| u8::get_hash(&x, &state)) + .map(|x| state.hash_one(x)) .collect::>() .into(); @@ -52,7 +52,7 @@ pub fn hash_utf8(array: &Utf8Array) -> PrimitiveArray { let values = array .values_iter() - .map(|x| <[u8]>::get_hash(&x.as_bytes(), &state)) + .map(|x| state.hash_one(x.as_bytes())) .collect::>() .into(); @@ -64,7 +64,7 @@ pub fn hash_binary(array: &BinaryArray) -> PrimitiveArray { let state = new_state!(); let values = array .values_iter() - .map(|x| <[u8]>::get_hash(&x, &state)) + .map(|x| state.hash_one(x)) .collect::>() .into();