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

Method ReadNewPage

cpp/src/parquet/column_reader.cc:705–735  ·  view source on GitHub ↗

Advance to the next data page

Source from the content-addressed store, hash-verified

703
704 // Advance to the next data page
705 bool ReadNewPage() {
706 // Loop until we find the next data page.
707 while (true) {
708 current_page_ = pager_->NextPage();
709 if (!current_page_) {
710 // EOS
711 return false;
712 }
713
714 if (current_page_->type() == PageType::DICTIONARY_PAGE) {
715 ConfigureDictionary(static_cast<const DictionaryPage*>(current_page_.get()));
716 continue;
717 } else if (current_page_->type() == PageType::DATA_PAGE) {
718 const auto* page = static_cast<const DataPageV1*>(current_page_.get());
719 const int64_t levels_byte_size = InitializeLevelDecoders(
720 *page, page->repetition_level_encoding(), page->definition_level_encoding());
721 InitializeDataDecoder(*page, levels_byte_size);
722 return true;
723 } else if (current_page_->type() == PageType::DATA_PAGE_V2) {
724 const auto* page = static_cast<const DataPageV2*>(current_page_.get());
725 int64_t levels_byte_size = InitializeLevelDecodersV2(*page);
726 InitializeDataDecoder(*page, levels_byte_size);
727 return true;
728 } else {
729 // We don't know what this page type is. We're allowed to skip non-data
730 // pages.
731 continue;
732 }
733 }
734 return true;
735 }
736
737 void ConfigureDictionary(const DictionaryPage* page) {
738 int encoding = static_cast<int>(page->encoding());

Callers

nothing calls this directly

Calls 5

NextPageMethod · 0.45
typeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected