| 40 | |
| 41 | template <typename DType> |
| 42 | void Decode(std::unique_ptr<typename EncodingTraits<DType>::Decoder>& decoder, |
| 43 | const std::string& input, std::vector<typename DType::c_type>* output, |
| 44 | size_t output_index) { |
| 45 | if (ARROW_PREDICT_FALSE(output_index >= output->size())) { |
| 46 | throw ParquetException("Index out of bound"); |
| 47 | } |
| 48 | |
| 49 | decoder->SetData(/*num_values=*/1, reinterpret_cast<const uint8_t*>(input.c_str()), |
| 50 | static_cast<int>(input.size())); |
| 51 | const auto num_values = decoder->Decode(&output->at(output_index), /*max_values=*/1); |
| 52 | if (ARROW_PREDICT_FALSE(num_values != 1)) { |
| 53 | throw ParquetException("Could not decode statistics value"); |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | template <> |
| 58 | void Decode<BooleanType>(std::unique_ptr<BooleanDecoder>& decoder, |
no test coverage detected