wiedld commented on code in PR #13802:
URL: https://github.com/apache/datafusion/pull/13802#discussion_r1888727574


##########
datafusion/functions/src/strings.rs:
##########
@@ -124,8 +125,18 @@ pub struct StringArrayBuilder {
 
 impl StringArrayBuilder {
     pub fn with_capacity(item_capacity: usize, data_capacity: usize) -> Self {
-        let mut offsets_buffer =
-            MutableBuffer::with_capacity((item_capacity + 1) * 
size_of::<i32>());
+        // MutableBuffer::with_capacity will round up to multiples of 
`ALIGNMENT`
+        let capacity = std::cmp::max(

Review Comment:
   I overthought things. Fixed.



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

Reply via email to