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

Function OptimalNumOfBytes

cpp/src/parquet/bloom_filter.h:232–236  ·  view source on GitHub ↗

Calculate optimal size according to the number of distinct values and false positive probability. @param ndv The number of distinct values. @param fpp The false positive probability. @return it always return a value between kMinimumBloomFilterBytes and kMaximumBloomFilterBytes, and the return value is always a power of 2

Source from the content-addressed store, hash-verified

230 /// @return it always return a value between kMinimumBloomFilterBytes and
231 /// kMaximumBloomFilterBytes, and the return value is always a power of 2
232 static uint32_t OptimalNumOfBytes(uint32_t ndv, double fpp) {
233 uint32_t optimal_num_of_bits = OptimalNumOfBits(ndv, fpp);
234 ARROW_DCHECK(::arrow::bit_util::IsMultipleOf8(optimal_num_of_bits));
235 return optimal_num_of_bits >> 3;
236 }
237
238 /// Calculate optimal size according to the number of distinct values and false
239 /// positive probability.

Callers 5

CreateBloomFilterMethod · 0.85
CreateBloomFilterFunction · 0.85
TESTFunction · 0.85
TESTFunction · 0.85
TYPED_TESTFunction · 0.85

Calls 2

OptimalNumOfBitsFunction · 0.85
IsMultipleOf8Function · 0.85

Tested by 3

TESTFunction · 0.68
TESTFunction · 0.68
TYPED_TESTFunction · 0.68