| 1802 | } |
| 1803 | |
| 1804 | void UpdateLevelHistogram(int64_t num_levels, const int16_t* def_levels, |
| 1805 | const int16_t* rep_levels) const { |
| 1806 | if (page_size_statistics_ == nullptr) { |
| 1807 | return; |
| 1808 | } |
| 1809 | |
| 1810 | auto add_levels = [](std::vector<int64_t>& level_histogram, const int16_t* levels, |
| 1811 | int64_t num_levels, int16_t max_level) { |
| 1812 | if (max_level == 0) { |
| 1813 | return; |
| 1814 | } |
| 1815 | ARROW_DCHECK_EQ(static_cast<size_t>(max_level) + 1, level_histogram.size()); |
| 1816 | std::span<const int16_t> level_span{levels, static_cast<size_t>(num_levels)}; |
| 1817 | ::parquet::UpdateLevelHistogram(level_span, level_histogram); |
| 1818 | }; |
| 1819 | |
| 1820 | add_levels(page_size_statistics_->definition_level_histogram, def_levels, num_levels, |
| 1821 | descr_->max_definition_level()); |
| 1822 | add_levels(page_size_statistics_->repetition_level_histogram, rep_levels, num_levels, |
| 1823 | descr_->max_repetition_level()); |
| 1824 | } |
| 1825 | |
| 1826 | // Update the unencoded data bytes for ByteArray only per the specification. |
| 1827 | void UpdateUnencodedDataBytes() const { |
nothing calls this directly
no test coverage detected