MCPcopy Create free account
hub / github.com/apache/arrow / Close

Method Close

cpp/src/parquet/column_writer.cc:666–687  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 9

UpdateEncryptionMethod · 0.80
FinishPageIndexesMethod · 0.80
FinishMethod · 0.45
num_valuesMethod · 0.45
data_page_offsetMethod · 0.45
total_compressed_sizeMethod · 0.45
WriteMethod · 0.45

Tested by

no test coverage detected