jdockerty commented on code in PR #13758:
URL: https://github.com/apache/datafusion/pull/13758#discussion_r1884151557
##########
datafusion/functions/src/strings.rs:
##########
@@ -185,7 +185,21 @@ impl StringArrayBuilder {
unsafe { self.offsets_buffer.push_unchecked(next_offset) };
}
+ /// Finalise the builder into a concrete [`StringArray`].
+ ///
+ /// # Panics
+ ///
+ /// This method can panic when:
+ ///
+ /// - the provided `null_buffer` is not the same length as the
`offsets_buffer`.
pub fn finish(self, null_buffer: Option<NullBuffer>) -> StringArray {
+ if let Some(ref null_buffer) = null_buffer {
+ assert_eq!(
+ null_buffer.len(),
+ self.offsets_buffer.len() / size_of::<i32>() - 1,
Review Comment:
Sounds reasonable to me, I've done this in
https://github.com/apache/datafusion/pull/13758/commits/a8a15fce1125e9ab0b531d51765e4ab3e50dd3d6
:+1:
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]