wgtmac commented on code in PR #40594:
URL: https://github.com/apache/arrow/pull/40594#discussion_r1860853782


##########
cpp/src/parquet/column_writer.cc:
##########
@@ -1554,6 +1591,46 @@ class TypedColumnWriterImpl : public ColumnWriterImpl, 
public TypedColumnWriter<
       rows_written_ += num_levels;
       num_buffered_rows_ += num_levels;
     }
+
+    UpdateLevelHistogram(num_levels, def_levels, rep_levels);
+  }
+
+  void UpdateLevelHistogram(int64_t num_levels, const int16_t* def_levels,
+                            const int16_t* rep_levels) const {
+    if (page_size_statistics_ == nullptr) {
+      return;
+    }
+
+    auto add_levels = [](std::vector<int64_t>& level_histogram,
+                         ::arrow::util::span<const int16_t> levels) {

Review Comment:
   `level_histogram` is indeed a vector and should be mutable. Using span for 
`levels` is better than raw pointers.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to