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

Method WriteLevelsSpaced

cpp/src/parquet/column_writer.cc:1776–1801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1774 }
1775
1776 void WriteLevelsSpaced(int64_t num_levels, const int16_t* def_levels,
1777 const int16_t* rep_levels) {
1778 // Update histograms now, to maximize cache efficiency.
1779 UpdateLevelHistogram(num_levels, def_levels, rep_levels);
1780
1781 // If the field is required and non-repeated, there are no definition levels
1782 if (descr_->max_definition_level() > 0) {
1783 WriteDefinitionLevels(num_levels, def_levels);
1784 }
1785 // Not present for non-repeated fields
1786 if (descr_->max_repetition_level() > 0) {
1787 // A row could include more than one value
1788 // Count the occasions where we start a new row
1789 for (int64_t i = 0; i < num_levels; ++i) {
1790 if (rep_levels[i] == 0) {
1791 rows_written_++;
1792 num_buffered_rows_++;
1793 }
1794 }
1795 WriteRepetitionLevels(num_levels, rep_levels);
1796 } else {
1797 // Each value is exactly one row
1798 rows_written_ += num_levels;
1799 num_buffered_rows_ += num_levels;
1800 }
1801 }
1802
1803 void UpdateLevelHistogram(int64_t num_levels, const int16_t* def_levels,
1804 const int16_t* rep_levels) const {

Callers

nothing calls this directly

Calls 1

UpdateLevelHistogramFunction · 0.85

Tested by

no test coverage detected