MCPcopy Create free account
hub / github.com/apache/arrow / FindHash

Method FindHash

cpp/src/parquet/bloom_filter.cc:348–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346}
347
348bool BlockSplitBloomFilter::FindHash(uint64_t hash) const {
349 const uint32_t bucket_index =
350 static_cast<uint32_t>(((hash >> 32) * (num_bytes_ / kBytesPerFilterBlock)) >> 32);
351 const uint32_t key = static_cast<uint32_t>(hash);
352 const uint32_t* bitset32 = reinterpret_cast<const uint32_t*>(data_->data());
353
354 for (int i = 0; i < kBitsSetPerBlock; ++i) {
355 // Calculate mask for key in the given bitset.
356 const uint32_t mask = UINT32_C(0x1) << ((key * SALT[i]) >> 27);
357 if (ARROW_PREDICT_FALSE(0 ==
358 (bitset32[kBitsSetPerBlock * bucket_index + i] & mask))) {
359 return false;
360 }
361 }
362 return true;
363}
364
365void BlockSplitBloomFilter::InsertHashImpl(uint64_t hash) {
366 const uint32_t bucket_index =

Callers 9

TYPED_TESTFunction · 0.80
BM_FindExistingHashFunction · 0.80
BM_FindNonExistingHashFunction · 0.80
TESTFunction · 0.80
TESTFunction · 0.80
FuzzReadBloomFilterFunction · 0.80
TESTFunction · 0.80

Calls 1

dataMethod · 0.45

Tested by 6

TYPED_TESTFunction · 0.64
TESTFunction · 0.64
TESTFunction · 0.64
TESTFunction · 0.64