scovich commented on code in PR #9432:
URL: https://github.com/apache/arrow-rs/pull/9432#discussion_r2831230733
##########
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:
There are at least two copies of this now... worth pulling out into an
`#[inline]` check function of some kind?
--
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]