diff options
author | robot-contrib <[email protected]> | 2025-07-31 18:00:57 +0300 |
---|---|---|
committer | robot-contrib <[email protected]> | 2025-07-31 18:24:59 +0300 |
commit | f621c90694c03bdc1992bd3cb726ff315a9627d5 (patch) | |
tree | aabd88e8bca000ac17fe21727b68d360189c6442 /contrib/libs/apache/orc/c++/src/Reader.cc | |
parent | 190037200407b9e5215a7af324af558d778588b5 (diff) |
Update contrib/libs/apache/orc to 2.2.0
commit_hash:e0bdaabcbb3fe0971f373bd76ccaccb105aff7d3
Diffstat (limited to 'contrib/libs/apache/orc/c++/src/Reader.cc')
-rw-r--r-- | contrib/libs/apache/orc/c++/src/Reader.cc | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/contrib/libs/apache/orc/c++/src/Reader.cc b/contrib/libs/apache/orc/c++/src/Reader.cc index f47c40ebbe0..7c35a834a5b 100644 --- a/contrib/libs/apache/orc/c++/src/Reader.cc +++ b/contrib/libs/apache/orc/c++/src/Reader.cc @@ -751,27 +751,35 @@ namespace orc { return *(contents_->schema.get()); } - std::unique_ptr<StripeStatistics> ReaderImpl::getStripeStatistics(uint64_t stripeIndex) const { + std::unique_ptr<StripeStatistics> ReaderImpl::getStripeStatistics(uint64_t stripeIndex, + bool includeRowIndex) const { if (!isMetadataLoaded_) { readMetadata(); } if (contents_->metadata == nullptr) { throw std::logic_error("No stripe statistics in file"); } - size_t num_cols = static_cast<size_t>( - contents_->metadata->stripe_stats(static_cast<int>(stripeIndex)).col_stats_size()); - std::vector<std::vector<proto::ColumnStatistics>> indexStats(num_cols); proto::StripeInformation currentStripeInfo = footer_->stripes(static_cast<int>(stripeIndex)); proto::StripeFooter currentStripeFooter = getStripeFooter(currentStripeInfo, *contents_.get()); - getRowIndexStatistics(currentStripeInfo, stripeIndex, currentStripeFooter, &indexStats); - const Timezone& writerTZ = currentStripeFooter.has_writer_timezone() ? getTimezoneByName(currentStripeFooter.writer_timezone()) : getLocalTimezone(); StatContext statContext(hasCorrectStatistics(), &writerTZ); - return std::make_unique<StripeStatisticsImpl>( + + if (!includeRowIndex) { + return std::make_unique<StripeStatisticsImpl>( + contents_->metadata->stripe_stats(static_cast<int>(stripeIndex)), statContext); + } + + size_t num_cols = static_cast<size_t>( + contents_->metadata->stripe_stats(static_cast<int>(stripeIndex)).col_stats_size()); + std::vector<std::vector<proto::ColumnStatistics>> indexStats(num_cols); + + getRowIndexStatistics(currentStripeInfo, stripeIndex, currentStripeFooter, &indexStats); + + return std::make_unique<StripeStatisticsWithRowGroupIndexImpl>( contents_->metadata->stripe_stats(static_cast<int>(stripeIndex)), indexStats, statContext); } @@ -865,6 +873,8 @@ namespace orc { case proto::Type_Kind_CHAR: case proto::Type_Kind_STRING: case proto::Type_Kind_VARCHAR: + case proto::Type_Kind_GEOMETRY: + case proto::Type_Kind_GEOGRAPHY: return 4; default: return 0; |