tustvold commented on a change in pull request #7076:
URL: https://github.com/apache/arrow/pull/7076#discussion_r418347285
##########
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:
This might be a touch on the pessimistic side, but appears to be the
same approximation made in `ComplexObjectArrayReader`. It would be nice to
somehow feed the data from `ComplexObjectArrayReader` through to the converter,
but this was a non-trivial change so I avoided it.
----------------------------------------------------------------
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:
[email protected]