Fokko commented on code in PR #9432:
URL: https://github.com/apache/arrow-rs/pull/9432#discussion_r2832231912


##########
arrow-array/src/builder/map_builder.rs:
##########
@@ -171,6 +171,24 @@ impl<K: ArrayBuilder, V: ArrayBuilder> MapBuilder<K, V> {
         Ok(())
     }
 
+    /// Append `n` nulls to this [`MapBuilder`]
+    ///
+    /// Returns an error if the key and values builders are in an inconsistent 
state.
+    #[inline]
+    pub fn append_nulls(&mut self, n: usize) -> Result<(), ArrowError> {
+        if self.key_builder.len() != self.value_builder.len() {
+            return Err(ArrowError::InvalidArgumentError(format!(
+                "Cannot append to a map builder when its keys and values have 
unequal lengths of {} and {}",
+                self.key_builder.len(),
+                self.value_builder.len()
+            )));
+        }

Review Comment:
   Wonderful idea, just pushed the change 👍 



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