| 664 | } |
| 665 | |
| 666 | void Close(bool has_dictionary, bool fallback) override { |
| 667 | if (pager_->meta_encryptor_ != nullptr) { |
| 668 | pager_->UpdateEncryption(encryption::kColumnMetaData); |
| 669 | } |
| 670 | // index_page_offset = -1 since they are not supported |
| 671 | PARQUET_ASSIGN_OR_THROW(int64_t final_position, final_sink_->Tell()); |
| 672 | // dictionary page offset should be 0 iff there are no dictionary pages |
| 673 | auto dictionary_page_offset = |
| 674 | has_dictionary_pages_ ? pager_->dictionary_page_offset() + final_position : 0; |
| 675 | metadata_->Finish(pager_->num_values(), dictionary_page_offset, -1, |
| 676 | pager_->data_page_offset() + final_position, |
| 677 | pager_->total_compressed_size(), pager_->total_uncompressed_size(), |
| 678 | has_dictionary, fallback, pager_->dict_encoding_stats_, |
| 679 | pager_->data_encoding_stats_, pager_->meta_encryptor_); |
| 680 | |
| 681 | // Buffered page writer needs to adjust page offsets. |
| 682 | pager_->FinishPageIndexes(final_position); |
| 683 | |
| 684 | // flush everything to the serialized sink |
| 685 | PARQUET_ASSIGN_OR_THROW(auto buffer, in_memory_sink_->Finish()); |
| 686 | PARQUET_THROW_NOT_OK(final_sink_->Write(buffer)); |
| 687 | } |
| 688 | |
| 689 | int64_t WriteDataPage(const DataPage& page) override { |
| 690 | return pager_->WriteDataPage(page); |
nothing calls this directly
no test coverage detected