Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Fixed hash
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Oct 12, 2022
1 parent 7cd8c49 commit 1f8e1f1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/compute/hash.rs
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -26,7 +26,7 @@ use super::arity::unary;
pub fn hash_primitive<T: NativeType + Hash>(array: &PrimitiveArray<T>) -> PrimitiveArray<u64> {
let state = new_state!();

unary(array, |x| T::get_hash(&x, &state), DataType::UInt64)
unary(array, |x| state.hash_one(x), DataType::UInt64)
}

#[multiversion]
Expand All @@ -37,7 +37,7 @@ pub fn hash_boolean(array: &BooleanArray) -> PrimitiveArray<u64> {

let values = array
.values_iter()
.map(|x| u8::get_hash(&x, &state))
.map(|x| state.hash_one(x))
.collect::<Vec<_>>()
.into();

Expand All @@ -52,7 +52,7 @@ pub fn hash_utf8<O: Offset>(array: &Utf8Array<O>) -> PrimitiveArray<u64> {

let values = array
.values_iter()
.map(|x| <[u8]>::get_hash(&x.as_bytes(), &state))
.map(|x| state.hash_one(x.as_bytes()))
.collect::<Vec<_>>()
.into();

Expand All @@ -64,7 +64,7 @@ pub fn hash_binary<O: Offset>(array: &BinaryArray<O>) -> PrimitiveArray<u64> {
let state = new_state!();
let values = array
.values_iter()
.map(|x| <[u8]>::get_hash(&x, &state))
.map(|x| state.hash_one(x))
.collect::<Vec<_>>()
.into();

Expand Down

0 comments on commit 1f8e1f1

Please sign in to comment.