Rafferty97 opened a new issue, #21864:
URL: https://github.com/apache/datafusion/issues/21864

   ### Describe the bug
   
   When reading the implementation of `StringViewArrayBuilder::with_capacity` 
at `datafusion/functions/src/strings.rs:136`:
   
   ```
       pub fn with_capacity(_item_capacity: usize, data_capacity: usize) -> 
Self {
           let builder = StringViewBuilder::with_capacity(data_capacity);
           Self {
               builder,
               block: String::new(),
           }
       }
   ```
   
   I could be mistaken, but I think that `item_capacity` should be passed to 
the inner `with_capacity` call rather than `data_capacity`. The 
`StringViewBuilder::with_capacity` call reserves space for the string offsets, 
which is proportional to the number of strings, not the total number of bytes 
used by those strings.
   
   Obviously this is just a performance bug, not a correctness issue.
   
   ### To Reproduce
   
   _No response_
   
   ### Expected behavior
   
   _No response_
   
   ### Additional context
   
   _No response_


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