alamb commented on code in PR #9720:
URL: https://github.com/apache/arrow-rs/pull/9720#discussion_r3093312240


##########
parquet/src/encodings/encoding/dict_encoder.rs:
##########
@@ -183,6 +183,6 @@ impl<T: DataType> Encoder<T> for DictEncoder<T> {
     ///
     /// For this encoder, the indices are unencoded bytes (refer to 
[`Self::write_indices`]).
     fn estimated_memory_size(&self) -> usize {
-        self.interner.storage().size_in_bytes + self.indices.len() * 
std::mem::size_of::<usize>()
+        self.interner.estimated_memory_size() + self.indices.len() * 
std::mem::size_of::<usize>()

Review Comment:
   I think this is the right direction (in the sense of account for the size in 
the structures that hold the memory, rather than the wrapper)
   
   However, it is not clear to me that KeyStorage includes the heap bytes for 
types like BYTE_ARRAY
   
   I think we need to add some tests for this code to make sure we have it right



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

Reply via email to