| 2313 | : Base(descr, Encoding::BYTE_STREAM_SPLIT) {} |
| 2314 | |
| 2315 | void SetData(int num_values, const uint8_t* data, int len) final { |
| 2316 | // Check that the data size is consistent with the number of values |
| 2317 | // The spec requires that the data size is a multiple of the number of values, |
| 2318 | // see: https://github.com/apache/parquet-format/pull/192 . |
| 2319 | // GH-41562: passed in `num_values` may include nulls, so we need to check and |
| 2320 | // adjust the number of values. |
| 2321 | if (static_cast<int64_t>(num_values) * this->type_length_ < len) { |
| 2322 | throw ParquetException( |
| 2323 | "Data size (" + std::to_string(len) + |
| 2324 | ") is too small for the number of values in in BYTE_STREAM_SPLIT (" + |
| 2325 | std::to_string(num_values) + ")"); |
| 2326 | } |
| 2327 | if (len % this->type_length_ != 0) { |
| 2328 | throw ParquetException("ByteStreamSplit data size " + std::to_string(len) + |
| 2329 | " not aligned with type " + TypeToString(DType::type_num) + |
| 2330 | " and byte width: " + std::to_string(this->type_length_)); |
| 2331 | } |
| 2332 | num_values = len / this->type_length_; |
| 2333 | Base::SetData(num_values, data, len); |
| 2334 | stride_ = this->num_values_; |
| 2335 | } |
| 2336 | |
| 2337 | int DecodeArrow(int num_values, int null_count, const uint8_t* valid_bits, |
| 2338 | int64_t valid_bits_offset, |
nothing calls this directly
no test coverage detected