| 188 | } |
| 189 | |
| 190 | int LevelDecoder::Decode(int batch_size, int16_t* levels) { |
| 191 | const int num_values = std::min(num_values_remaining_, batch_size); |
| 192 | const int num_decoded = impl_->GetBatch(levels, num_values); |
| 193 | if (num_decoded > 0) { |
| 194 | internal::MinMax min_max = internal::FindMinMax(levels, num_decoded); |
| 195 | if (ARROW_PREDICT_FALSE(min_max.min < 0 || min_max.max > max_level_)) { |
| 196 | std::stringstream ss; |
| 197 | ss << "Malformed levels. min: " << min_max.min << " max: " << min_max.max |
| 198 | << " out of range. Max Level: " << max_level_; |
| 199 | throw ParquetException(ss.str()); |
| 200 | } |
| 201 | } |
| 202 | num_values_remaining_ -= num_decoded; |
| 203 | return num_decoded; |
| 204 | } |
| 205 | |
| 206 | int LevelDecoder::Skip(int batch_size) { |
| 207 | const int num_values = std::min(num_values_remaining_, batch_size); |
no test coverage detected