sdf-jkl commented on code in PR #9685:
URL: https://github.com/apache/arrow-rs/pull/9685#discussion_r3064539507


##########
parquet-variant-compute/src/variant_array_builder.rs:
##########
@@ -156,6 +156,26 @@ impl VariantArrayBuilder {
         self.value_offsets.push(self.value_builder.offset());
     }
 
+    /// Appends `count` null rows to the builder.
+    pub fn append_nulls(&mut self, count: usize) {
+        if count == 0 {
+            return;
+        }
+        if count == 1 {

Review Comment:
   I think this function is on a hotpath, so the extra branching should not 
matter in practice. We use `append_nulls` for bulk appends, where branch 
overhead is negligible compared to the work saved.
   
   The only potentially hotpath today is `string_array_to_variant`, where we 
try to coalesce consecutive nulls. If most runs are length 1, this could add a 
small overhead versus calling `append_null` directly, but this cost should be 
negligible compared to the overall benefit from batching.



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