jdockerty commented on code in PR #13758:
URL: https://github.com/apache/datafusion/pull/13758#discussion_r1884070010
##########
datafusion/functions/src/strings.rs:
##########
@@ -335,7 +335,27 @@ impl LargeStringArrayBuilder {
unsafe { self.offsets_buffer.push_unchecked(next_offset) };
}
+ /// Finalise the builder into a concrete [`LargeStringArray`].
+ ///
+ /// # Panics
+ ///
+ /// This method can panic when:
+ ///
+ /// - the provided `null_buffer` is not the same length as the
`offsets_buffer`.
+ /// - the provided `null_buffer` is not the same length as the
`value_buffer`.
pub fn finish(self, null_buffer: Option<NullBuffer>) -> LargeStringArray {
+ if let Some(ref null_buffer) = null_buffer {
+ assert_eq!(
+ null_buffer.len(),
+ self.offsets_buffer.len() / size_of::<i64>() - 1,
+ "Null buffer and offsets buffer must be the same length"
+ );
+ assert_eq!(
Review Comment:
No worries, I'll remove this 2nd assertion now :100:
--
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]