You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Rationale for this change
This PR follows apache/arrow-rs#9628. It supports optimizing the disk usage of the Bloom filter. So specifying an ndv value larger than the actual value will not affect disk usage.
> Bloom filters now support folding mode: allocate a conservatively large filter (sized for worst-case NDV), insert all values during writing, then fold down at flush time to meet a target FPP. This eliminates the need to guess NDV upfront and produces optimally-sized filters automatically.
### What changes are included in this PR?
`BloomFilterBuilder` will try to fold the bloom filter before writing it to the output stream.
### Are these changes tested?
Yes.
### Are there any user-facing changes?
Yes.
The type of `ndv` in `BloomFilterOptions` is changed from `int32_t` to `std::optional<int64_t>`. And the argument type of `OptimalNumOfBytes` and `OptimalNumOfBits` in `BlockSplitBloomFilter` is changed from `uint32_t ndv` to `uint64_t ndv`.
Add a new field `fold` in `BloomFilterOptions` and default value is `true`.
* GitHub Issue: #50007
Lead-authored-by: Zehua Zou <zehuazou2000@gmail.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Signed-off-by: Antoine Pitrou <antoine@python.org>
0 commit comments