| 353 | } |
| 354 | |
| 355 | void BlockSplitBloomFilter::WriteTo(ArrowOutputStream* sink) const { |
| 356 | DCHECK(sink != nullptr); |
| 357 | |
| 358 | format::BloomFilterHeader header; |
| 359 | if (ARROW_PREDICT_FALSE(algorithm_ != BloomFilter::Algorithm::BLOCK)) { |
| 360 | throw ParquetException("BloomFilter does not support Algorithm other than BLOCK"); |
| 361 | } |
| 362 | header.algorithm.__set_BLOCK(format::SplitBlockAlgorithm()); |
| 363 | if (ARROW_PREDICT_FALSE(hash_strategy_ != HashStrategy::XXHASH)) { |
| 364 | throw ParquetException("BloomFilter does not support Hash other than XXHASH"); |
| 365 | } |
| 366 | header.hash.__set_XXHASH(format::XxHash()); |
| 367 | if (ARROW_PREDICT_FALSE(compression_strategy_ != CompressionStrategy::UNCOMPRESSED)) { |
| 368 | throw ParquetException( |
| 369 | "BloomFilter does not support Compression other than UNCOMPRESSED"); |
| 370 | } |
| 371 | header.compression.__set_UNCOMPRESSED(format::Uncompressed()); |
| 372 | header.__set_numBytes(num_bytes_); |
| 373 | |
| 374 | ThriftSerializer serializer; |
| 375 | serializer.Serialize(&header, sink); |
| 376 | |
| 377 | PARQUET_THROW_NOT_OK(sink->Write(data_->data(), num_bytes_)); |
| 378 | } |
| 379 | |
| 380 | void BlockSplitBloomFilter::FoldToTargetFpp(double target_fpp) { |
| 381 | const auto num_bits = static_cast<int64_t>(num_bytes_) * 8; |
nothing calls this directly
no test coverage detected