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

Method UpdateLevelHistogram

cpp/src/parquet/column_writer.cc:1803–1823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

UpdateLevelHistogramFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected