Skip to content

Commit 64a7dd5

Browse files
alambshepmaster
andauthored
Upgrade to twox-hash 2.0 (#7347)
Co-authored-by: Jake Goulding <jake.goulding@integer32.com>
1 parent 697cca7 commit 64a7dd5

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

parquet/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ seq-macro = { version = "0.3", default-features = false }
6565
futures = { version = "0.3", default-features = false, features = ["std"], optional = true }
6666
tokio = { version = "1.0", optional = true, default-features = false, features = ["macros", "rt", "io-util"] }
6767
hashbrown = { version = "0.15", default-features = false }
68-
twox-hash = { version = "1.6", default-features = false }
68+
twox-hash = { version = "2.0", default-features = false, features = ["xxhash64"] }
6969
paste = { version = "1.0" }
7070
half = { version = "2.1", default-features = false, features = ["num-traits"] }
7171
sysinfo = { version = "0.33.0", optional = true, default-features = false, features = ["system"] }

parquet/src/bloom_filter/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ use crate::format::{
8282
};
8383
use crate::thrift::{TCompactSliceInputProtocol, TSerializable};
8484
use bytes::Bytes;
85-
use std::hash::Hasher;
8685
use std::io::Write;
8786
use std::sync::Arc;
8887
use thrift::protocol::{TCompactOutputProtocol, TOutputProtocol};
@@ -397,9 +396,7 @@ const SEED: u64 = 0;
397396

398397
#[inline]
399398
fn hash_as_bytes<A: AsBytes + ?Sized>(value: &A) -> u64 {
400-
let mut hasher = XxHash64::with_seed(SEED);
401-
hasher.write(value.as_bytes());
402-
hasher.finish()
399+
XxHash64::oneshot(SEED, value.as_bytes())
403400
}
404401

405402
#[cfg(test)]

0 commit comments

Comments
 (0)