tustvold commented on a change in pull request #7076:
URL: https://github.com/apache/arrow/pull/7076#discussion_r418774678



##########
File path: rust/parquet/src/arrow/converter.rs
##########
@@ -128,7 +128,10 @@ pub struct Utf8ArrayConverter {}
 
 impl Converter<Vec<Option<ByteArray>>, StringArray> for Utf8ArrayConverter {
     fn convert(source: Vec<Option<ByteArray>>) -> Result<StringArray> {
-        let mut builder = StringBuilder::new(source.len());
+        let mut builder = StringBuilder::with_capacity(
+            source.len(),
+            source.len() * std::mem::size_of::<ByteArray>(),

Review comment:
       Having revisited this, not only is it pessimistic - it's plain wrong :). 
The ByteArray type here is just a wrapper pointer struct and its size in memory 
has no semantic value. This is fixed in the latest version which computes the 
correct array capacity.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to