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

Function ValidateBloomFilterHeader

cpp/src/parquet/bloom_filter.cc:114–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112constexpr uint32_t kBloomFilterHeaderSizeGuess = 256;
113
114::arrow::Status ValidateBloomFilterHeader(const format::BloomFilterHeader& header) {
115 if (!header.algorithm.__isset.BLOCK) {
116 return ::arrow::Status::Invalid(
117 "Unsupported Bloom filter algorithm: ", header.algorithm, ".");
118 }
119
120 if (!header.hash.__isset.XXHASH) {
121 return ::arrow::Status::Invalid("Unsupported Bloom filter hash: ", header.hash, ".");
122 }
123
124 if (!header.compression.__isset.UNCOMPRESSED) {
125 return ::arrow::Status::Invalid(
126 "Unsupported Bloom filter compression: ", header.compression, ".");
127 }
128
129 if (header.numBytes <= 0 ||
130 static_cast<uint32_t>(header.numBytes) > BloomFilter::kMaximumBloomFilterBytes) {
131 std::stringstream ss;
132 ss << "Bloom filter size is incorrect: " << header.numBytes << ". Must be in range ("
133 << 0 << ", " << BloomFilter::kMaximumBloomFilterBytes << "].";
134 return ::arrow::Status::Invalid(ss.str());
135 }
136
137 return ::arrow::Status::OK();
138}
139
140BlockSplitBloomFilter DeserializeEncryptedFromStream(
141 const ReaderProperties& properties, ArrowInputStream* input,

Callers 2

DeserializeMethod · 0.85

Calls 3

strMethod · 0.80
InvalidFunction · 0.50
OKFunction · 0.50

Tested by

no test coverage detected