adriangb commented on code in PR #11641:
URL: https://github.com/apache/arrow-rs/pull/11641#discussion_r4569591309
##########
parquet/src/bloom_filter/mod.rs:
##########
@@ -563,6 +579,64 @@ impl Sbbf {
self.0[block_index].check(hash as u32)
}
+ /// Same result as [`Self::check_hash`], without data-dependent branches.
+ #[cfg_attr(not(any(feature = "arrow", test)), expect(dead_code))]
+ #[inline(always)]
+ fn check_hash_branch_free(&self, hash: u64) -> bool {
+ let block_index = self.hash_to_block_index(hash);
+ self.0[block_index].check_branch_free(hash as u32)
+ }
+
+ /// Inserts precomputed 64-bit hashes.
+ ///
+ /// The filter can hold hashes from any well-mixed 64-bit hash function,
+ /// but [`Self::check`] only finds values whose hashes were computed as
+ /// the Parquet specification requires (xxHash64, seed 0, of the plain
+ /// encoding). Use [`Self::check_hashes`] with the same hash function.
+ pub fn insert_hashes(&mut self, hashes: &[u64]) {
+ for &hash in hashes {
+ self.insert_hash(hash);
+ }
+ }
+
+ /// Checks precomputed 64-bit hashes (see [`Self::insert_hashes`]).
+ ///
+ /// Bit `i` of the result is set if `hashes[i]` may be in the filter. The
+ /// check has no data-dependent branches, which is much faster than
Review Comment:
Sorry looks like 71e9f1e7ab5cc709a27608391fe06ef773ccae7a had gotten lost /
overwritten. I now adopted your wording from
https://github.com/apache/arrow-rs/pull/11641#discussion_r4568537149 (bfa6657e3)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]