yonipeleg33 commented on code in PR #12507:
URL: https://github.com/apache/arrow-rs/pull/12507#discussion_r4738489213


##########
parquet/src/column/writer/mod.rs:
##########
@@ -750,6 +750,68 @@ impl<'a, E: ColumnValueEncoder> GenericColumnWriter<'a, E> 
{
         )
     }
 
+    /// Writes `num_levels` levels that all share the same definition level,
+    /// without requiring a materialized definition level buffer.
+    ///
+    /// This is equivalent to calling [`Self::write_batch_with_statistics`] 
with
+    /// `def_levels` set to `num_levels` copies of `def_level` and no 
repetition
+    /// levels, but avoids allocating and scanning that buffer. This is useful
+    /// for writing long runs of nulls, or of non-null values, into sparse
+    /// columns.
+    ///
+    /// If `def_level` equals the column's max definition level, `values` must
+    /// contain at least `num_levels` values. Otherwise every level is null and
+    /// no values are read.
+    ///
+    /// Returns the number of values written.
+    ///
+    /// `min`, `max` and `distinct_count` behave as in
+    /// [`Self::write_batch_with_statistics`].
+    ///
+    /// # Errors
+    ///
+    /// Returns an error if the column is repeated (max repetition level > 0),
+    /// or if `def_level` is negative or greater than the column's max
+    /// definition level.
+    pub fn write_batch_with_uniform_def_level(
+        &mut self,
+        values: &E::Values,
+        def_level: i16,
+        num_levels: usize,
+        min: Option<&E::T>,
+        max: Option<&E::T>,
+        distinct_count: Option<u64>,
+    ) -> Result<usize> {
+        if self.descr.max_rep_level() > 0 {

Review Comment:
   good points. let's wait for the maintainers to weigh in on this



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