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

Method FoldToTargetFpp

cpp/src/parquet/bloom_filter.cc:380–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378}
379
380void BlockSplitBloomFilter::FoldToTargetFpp(double target_fpp) {
381 const auto num_bits = static_cast<int64_t>(num_bytes_) * 8;
382 const auto total_set_bits =
383 ::arrow::internal::CountSetBits(data_->data(), /*bit_offset=*/0, num_bits);
384 if (total_set_bits == 0) {
385 num_bytes_ = kMinimumBloomFilterBytes;
386 return;
387 }
388
389 const double avg_fill = static_cast<double>(total_set_bits) / num_bits;
390 const uint32_t num_folds = NumFoldsForTargetFpp(target_fpp, avg_fill);
391 if (num_folds > 0) {
392 Fold(num_folds);
393 }
394}
395
396uint32_t BlockSplitBloomFilter::NumFoldsForTargetFpp(double target_fpp,
397 double avg_fill) const {

Callers 1

WriteToMethod · 0.80

Calls 2

CountSetBitsFunction · 0.50
dataMethod · 0.45

Tested by

no test coverage detected