| 2247 | : Base(descr, Encoding::BYTE_STREAM_SPLIT) {} |
| 2248 | |
| 2249 | void SetData(int num_values, const uint8_t* data, int len) final { |
| 2250 | // Check that the data size is consistent with the number of values |
| 2251 | // The spec requires that the data size is a multiple of the number of values, |
| 2252 | // see: https://github.com/apache/parquet-format/pull/192 . |
| 2253 | // GH-41562: passed in `num_values` may include nulls, so we need to check and |
| 2254 | // adjust the number of values. |
| 2255 | if (static_cast<int64_t>(num_values) * this->type_length_ < len) { |
| 2256 | throw ParquetException( |
| 2257 | "Data size (" + std::to_string(len) + |
| 2258 | ") is too small for the number of values in in BYTE_STREAM_SPLIT (" + |
| 2259 | std::to_string(num_values) + ")"); |
| 2260 | } |
| 2261 | if (len % this->type_length_ != 0) { |
| 2262 | throw ParquetException("ByteStreamSplit data size " + std::to_string(len) + |
| 2263 | " not aligned with type " + TypeToString(DType::type_num) + |
| 2264 | " and byte width: " + std::to_string(this->type_length_)); |
| 2265 | } |
| 2266 | num_values = len / this->type_length_; |
| 2267 | Base::SetData(num_values, data, len); |
| 2268 | stride_ = this->num_values_; |
| 2269 | } |
| 2270 | |
| 2271 | int DecodeArrow(int num_values, int null_count, const uint8_t* valid_bits, |
| 2272 | int64_t valid_bits_offset, |
nothing calls this directly
no test coverage detected