| 112 | constexpr 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 | |
| 140 | BlockSplitBloomFilter DeserializeEncryptedFromStream( |
| 141 | const ReaderProperties& properties, ArrowInputStream* input, |
no test coverage detected