| 583 | } |
| 584 | |
| 585 | std::shared_ptr<Buffer> FlushValues() override { |
| 586 | const int64_t buffer_size = EstimatedDataEncodedSize(); |
| 587 | if (buffer_size > std::numeric_limits<int>::max()) { |
| 588 | std::stringstream ss; |
| 589 | ss << "Buffer size for DictEncoder (" << buffer_size |
| 590 | << ") exceeds maximum int value"; |
| 591 | throw ParquetException(ss.str()); |
| 592 | } |
| 593 | std::shared_ptr<ResizableBuffer> buffer = AllocateBuffer(this->pool_, buffer_size); |
| 594 | int result_size = WriteIndices(buffer->mutable_data(), static_cast<int>(buffer_size)); |
| 595 | PARQUET_THROW_NOT_OK(buffer->Resize(result_size, false)); |
| 596 | return buffer; |
| 597 | } |
| 598 | |
| 599 | /// Writes out the encoded dictionary to buffer. buffer must be preallocated to |
| 600 | /// dict_encoded_size() bytes. |
nothing calls this directly
no test coverage detected