Read one index per value and copy that dictionary entry's type_length bytes contiguously into the caller's buffer. Mirrors DecodeArrow without nulls.
| 1463 | // Read one index per value and copy that dictionary entry's type_length bytes |
| 1464 | // contiguously into the caller's buffer. Mirrors DecodeArrow without nulls. |
| 1465 | int Decode(uint8_t* buffer, int max_values) override { |
| 1466 | max_values = std::min(max_values, this->num_values_); |
| 1467 | const auto* dict_values = this->dictionary_->data_as<FLBA>(); |
| 1468 | const int64_t type_length = this->type_length_; |
| 1469 | for (int i = 0; i < max_values; ++i) { |
| 1470 | int32_t index; |
| 1471 | if (ARROW_PREDICT_FALSE(!this->idx_decoder_.Get(&index))) { |
| 1472 | throw ParquetException("Dict decoding failed"); |
| 1473 | } |
| 1474 | PARQUET_THROW_NOT_OK(this->IndexInBounds(index)); |
| 1475 | memcpy(buffer + i * type_length, dict_values[index].ptr, |
| 1476 | static_cast<size_t>(type_length)); |
| 1477 | } |
| 1478 | this->num_values_ -= max_values; |
| 1479 | return max_values; |
| 1480 | } |
| 1481 | }; |
| 1482 | |
| 1483 | // ---------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected