| 187 | |
| 188 | template <typename T> |
| 189 | inline int BatchedBitReader::UnpackAndDecodeBatch( |
| 190 | int bit_width, T* dict, int64_t dict_len, int num_values, T* v, int64_t stride) { |
| 191 | DCHECK(buffer_pos_ != nullptr); |
| 192 | DCHECK_GE(bit_width, 0); |
| 193 | DCHECK_LE(bit_width, MAX_BITWIDTH); |
| 194 | DCHECK_GE(num_values, 0); |
| 195 | |
| 196 | const uint8_t* new_buffer_pos; |
| 197 | int64_t num_read; |
| 198 | bool decode_error = false; |
| 199 | std::tie(new_buffer_pos, num_read) = BitPacking::UnpackAndDecodeValues(bit_width, |
| 200 | buffer_pos_, bytes_left(), dict, dict_len, num_values, v, stride, &decode_error); |
| 201 | if (UNLIKELY(decode_error)) return -1; |
| 202 | buffer_pos_ = new_buffer_pos; |
| 203 | DCHECK_LE(buffer_pos_, buffer_end_); |
| 204 | DCHECK_LE(num_read, num_values); |
| 205 | return static_cast<int>(num_read); |
| 206 | } |
| 207 | |
| 208 | template <typename T, typename ParquetType> |
| 209 | inline int BatchedBitReader::UnpackAndDeltaDecodeBatch( |