PLAIN-encoded FLBA values are already contiguous in the page buffer, so decode them with a single memcpy into the caller's buffer. This is the same copy used by PlainDecoder ::DecodeArrow, without the builder.
| 861 | // decode them with a single memcpy into the caller's buffer. This is the same |
| 862 | // copy used by PlainDecoder<FLBAType>::DecodeArrow, without the builder. |
| 863 | int Decode(uint8_t* buffer, int max_values) override { |
| 864 | max_values = std::min(max_values, this->num_values_); |
| 865 | const int64_t bytes_to_decode = static_cast<int64_t>(this->type_length_) * max_values; |
| 866 | if (bytes_to_decode > this->len_) { |
| 867 | ParquetException::EofException(); |
| 868 | } |
| 869 | if (bytes_to_decode > 0) { |
| 870 | memcpy(buffer, this->data_, static_cast<size_t>(bytes_to_decode)); |
| 871 | } |
| 872 | this->data_ += bytes_to_decode; |
| 873 | this->len_ -= static_cast<int>(bytes_to_decode); |
| 874 | this->num_values_ -= max_values; |
| 875 | return max_values; |
| 876 | } |
| 877 | }; |
| 878 | |
| 879 | // ---------------------------------------------------------------------- |
nothing calls this directly
no outgoing calls
no test coverage detected