MCPcopy Create free account
hub / github.com/apache/orc / preBuffer

Method preBuffer

c++/src/Reader.cc:1773–1801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1771 }
1772
1773 void ReaderImpl::preBuffer(const std::vector<uint32_t>& stripes,
1774 const std::list<uint64_t>& includeTypes) {
1775 std::vector<uint32_t> newStripes;
1776 for (auto stripe : stripes) {
1777 if (stripe < static_cast<uint32_t>(footer_->stripes_size())) newStripes.push_back(stripe);
1778 }
1779
1780 std::list<uint64_t> newIncludeTypes;
1781 for (auto type : includeTypes) {
1782 if (type < static_cast<uint64_t>(footer_->types_size())) newIncludeTypes.push_back(type);
1783 }
1784
1785 if (newStripes.empty() || newIncludeTypes.empty()) {
1786 return;
1787 }
1788
1789 orc::RowReaderOptions rowReaderOptions;
1790 rowReaderOptions.includeTypes(newIncludeTypes);
1791 ColumnSelector columnSelector(contents_.get());
1792 std::vector<bool> selectedColumns;
1793 columnSelector.updateSelected(selectedColumns, rowReaderOptions);
1794
1795 for (auto stripe : newStripes) {
1796 const auto& stripeInfo = footer_->stripes(stripe);
1797 proto::StripeFooter stripeFooter = getStripeFooter(stripeInfo, *contents_);
1798 auto ranges = extractReadRangesForStripe(stripe, stripeInfo, stripeFooter, selectedColumns);
1799 contents_->cacheRanges(std::move(ranges));
1800 }
1801 }
1802
1803 RowReader::~RowReader() {
1804 // PASS

Callers 3

createNestedMapMemReaderFunction · 0.80

Calls 5

getStripeFooterFunction · 0.85
cacheRangesMethod · 0.80
getMethod · 0.45
updateSelectedMethod · 0.45

Tested by 3

createNestedMapMemReaderFunction · 0.64