| 321 | } |
| 322 | |
| 323 | void BlockSplitBloomFilter::WriteTo(ArrowOutputStream* sink) const { |
| 324 | DCHECK(sink != nullptr); |
| 325 | |
| 326 | format::BloomFilterHeader header; |
| 327 | if (ARROW_PREDICT_FALSE(algorithm_ != BloomFilter::Algorithm::BLOCK)) { |
| 328 | throw ParquetException("BloomFilter does not support Algorithm other than BLOCK"); |
| 329 | } |
| 330 | header.algorithm.__set_BLOCK(format::SplitBlockAlgorithm()); |
| 331 | if (ARROW_PREDICT_FALSE(hash_strategy_ != HashStrategy::XXHASH)) { |
| 332 | throw ParquetException("BloomFilter does not support Hash other than XXHASH"); |
| 333 | } |
| 334 | header.hash.__set_XXHASH(format::XxHash()); |
| 335 | if (ARROW_PREDICT_FALSE(compression_strategy_ != CompressionStrategy::UNCOMPRESSED)) { |
| 336 | throw ParquetException( |
| 337 | "BloomFilter does not support Compression other than UNCOMPRESSED"); |
| 338 | } |
| 339 | header.compression.__set_UNCOMPRESSED(format::Uncompressed()); |
| 340 | header.__set_numBytes(num_bytes_); |
| 341 | |
| 342 | ThriftSerializer serializer; |
| 343 | serializer.Serialize(&header, sink); |
| 344 | |
| 345 | PARQUET_THROW_NOT_OK(sink->Write(data_->data(), num_bytes_)); |
| 346 | } |
| 347 | |
| 348 | bool BlockSplitBloomFilter::FindHash(uint64_t hash) const { |
| 349 | const uint32_t bucket_index = |
nothing calls this directly
no test coverage detected