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

Method getStripeStatistics

c++/src/Reader.cc:837–867  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

835 }
836
837 std::unique_ptr<StripeStatistics> ReaderImpl::getStripeStatistics(uint64_t stripeIndex,
838 bool includeRowIndex) const {
839 if (!isMetadataLoaded_) {
840 readMetadata();
841 }
842 if (contents_->metadata == nullptr) {
843 throw std::logic_error("No stripe statistics in file");
844 }
845
846 proto::StripeInformation currentStripeInfo = footer_->stripes(static_cast<int>(stripeIndex));
847 proto::StripeFooter currentStripeFooter = getStripeFooter(currentStripeInfo, *contents_.get());
848
849 const Timezone& writerTZ = currentStripeFooter.has_writer_timezone()
850 ? getTimezoneByName(currentStripeFooter.writer_timezone())
851 : getLocalTimezone();
852 StatContext statContext(hasCorrectStatistics(), &writerTZ);
853
854 if (!includeRowIndex) {
855 return std::make_unique<StripeStatisticsImpl>(
856 contents_->metadata->stripe_stats(static_cast<int>(stripeIndex)), statContext);
857 }
858
859 size_t num_cols = static_cast<size_t>(
860 contents_->metadata->stripe_stats(static_cast<int>(stripeIndex)).col_stats_size());
861 std::vector<std::vector<proto::ColumnStatistics>> indexStats(num_cols);
862
863 getRowIndexStatistics(currentStripeInfo, stripeIndex, currentStripeFooter, &indexStats);
864
865 return std::make_unique<StripeStatisticsWithRowGroupIndexImpl>(
866 contents_->metadata->stripe_stats(static_cast<int>(stripeIndex)), indexStats, statContext);
867 }
868
869 std::unique_ptr<Statistics> ReaderImpl::getStatistics() const {
870 StatContext statContext(hasCorrectStatistics());

Callers

nothing calls this directly

Calls 2

getStripeFooterFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected