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

Method WriteTo

cpp/src/parquet/bloom_filter.cc:355–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353}
354
355void 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
380void BlockSplitBloomFilter::FoldToTargetFpp(double target_fpp) {
381 const auto num_bits = static_cast<int64_t>(num_bytes_) * 8;

Callers

nothing calls this directly

Calls 11

ParquetExceptionFunction · 0.85
SplitBlockAlgorithmClass · 0.85
XxHashClass · 0.85
UncompressedClass · 0.85
__set_BLOCKMethod · 0.80
__set_XXHASHMethod · 0.80
__set_UNCOMPRESSEDMethod · 0.80
__set_numBytesMethod · 0.80
SerializeMethod · 0.45
WriteMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected