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


##########
cpp/src/parquet/page_index.cc:
##########
@@ -533,6 +569,21 @@ class ColumnIndexBuilderImpl final : public 
ColumnIndexBuilder {
     /// Decide the boundary order from decoded min/max values.
     auto boundary_order = DetermineBoundaryOrder(min_values, max_values);
     column_index_.__set_boundary_order(ToThrift(boundary_order));
+
+    /// Finalize level histogram.
+    const int64_t num_pages = column_index_.null_pages.size();
+    const int64_t rep_level_hist_size = 
column_index_.repetition_level_histograms.size();
+    const int64_t def_level_hist_size = 
column_index_.definition_level_histograms.size();
+    if (rep_level_hist_size == (descr_->max_repetition_level() + 1) * 
num_pages) {
+      column_index_.__isset.repetition_level_histograms = true;
+    } else {

Review Comment:
   Make sense. I was intended to not let it fail. But it would be a writer bug 
if it happens.



-- 
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