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

Function ValidateBloomFilterHeader

cpp/src/parquet/bloom_filter.cc:146–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144constexpr uint32_t kBloomFilterHeaderSizeGuess = 256;
145
146::arrow::Status ValidateBloomFilterHeader(const format::BloomFilterHeader& header) {
147 if (!header.algorithm.__isset.BLOCK) {
148 return ::arrow::Status::Invalid(
149 "Unsupported Bloom filter algorithm: ", header.algorithm, ".");
150 }
151
152 if (!header.hash.__isset.XXHASH) {
153 return ::arrow::Status::Invalid("Unsupported Bloom filter hash: ", header.hash, ".");
154 }
155
156 if (!header.compression.__isset.UNCOMPRESSED) {
157 return ::arrow::Status::Invalid(
158 "Unsupported Bloom filter compression: ", header.compression, ".");
159 }
160
161 if (header.numBytes <= 0 ||
162 static_cast<uint32_t>(header.numBytes) > BloomFilter::kMaximumBloomFilterBytes) {
163 std::stringstream ss;
164 ss << "Bloom filter size is incorrect: " << header.numBytes << ". Must be in range ("
165 << 0 << ", " << BloomFilter::kMaximumBloomFilterBytes << "].";
166 return ::arrow::Status::Invalid(ss.str());
167 }
168
169 return ::arrow::Status::OK();
170}
171
172BlockSplitBloomFilter DeserializeEncryptedFromStream(
173 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