etseidl commented on code in PR #9653:
URL: https://github.com/apache/arrow-rs/pull/9653#discussion_r3030703425


##########
parquet/src/arrow/arrow_writer/levels.rs:
##########
@@ -846,6 +927,32 @@ impl ArrayLevels {
             max_rep_level: self.max_rep_level,
             array,
             logical_nulls,
+            uniform_levels: None,
+        }
+    }
+
+    /// If all levels are uniform (e.g., column is entirely null), returns
+    /// `(def_level_value, rep_level_value, count)` without materializing any 
Vec.
+    pub fn uniform_levels(&self) -> Option<(i16, i16, usize)> {
+        self.uniform_levels
+    }
+
+    /// Bulk-emit `count` uniform null def/rep levels. If the level Vecs are
+    /// still empty, stores a compact `uniform_levels` tuple instead of
+    /// materializing the Vecs. Otherwise falls back to extending them.
+    fn extend_uniform_null_levels(&mut self, def_val: i16, rep_val: i16, 
count: usize) {

Review Comment:
   I'll preface with the admission I'm not all that familiar with this part of 
the code. So if this is called after some levels have been added to the vecs, 
it will extend the vecs. What happens in the reverse case, after setting 
`uniform_levels` an attempt is made to extend the level vecs?



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