ansh0014 commented on issue #55824:
URL: https://github.com/apache/arrow/issues/55824#issuecomment-7278437086

   Hi! @raulcd 
   I traced this in the C++ Parquet Bloom filter implementation and wanted to 
confirm the fix before opening a PR.
   
   In `cpp/src/parquet/bloom_filter.cc`, `BlockSplitBloomFilter::Init(const 
uint8_t* bitset, uint32_t num_bytes)` currently rejects any size that isn't a 
power of two (`(num_bytes & (num_bytes - 1)) != 0`), throwing `"Given length of 
bitset is illegal"`.
   
   However, `FindHash`, `InsertHashImpl`, and `NumBlocks()` already use 
`fastrange` (`((hash >> 32) * NumBlocks()) >> 32`), which works for any valid 
number of 32-byte blocks (`num_bytes % kBytesPerFilterBlock == 0`), not just 
powers of two.
   
   My plan is to:
   1. Update `BlockSplitBloomFilter::Init(const uint8_t* bitset, uint32_t 
num_bytes)` to require `num_bytes % kBytesPerFilterBlock == 0` within 
`[kMinimumBloomFilterBytes, kMaximumBloomFilterBytes]` instead of requiring a 
power of two (keeping the writer-side `Init(uint32_t num_bytes)` unchanged).
   2. Update `cpp/src/parquet/bloom_filter_test.cc` to test 
initializing/deserializing and querying a 96-byte (3-block) Bloom filter, while 
still rejecting sizes that aren't multiples of 32 bytes.
   
   Does this approach look good? If so, could you please assign this issue to 
me?


-- 
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]

Reply via email to