etseidl commented on code in PR #10842:
URL: https://github.com/apache/arrow-rs/pull/10842#discussion_r3918332991
##########
parquet/src/file/metadata/mod.rs:
##########
@@ -507,19 +229,56 @@ impl ParquetMetaData {
#[cfg(not(feature = "encryption"))]
let encryption_size = 0usize;
+ // We can only determine the heap size for PageIndex. Custom providers
are
+ // out of scope.
+ let page_index_size = if let Some(page_index) =
self.page_index.as_ref() {
+ if let Some(page_index) =
page_index.as_any().downcast_ref::<PageIndex>() {
+ let page_index = Some(Arc::new(page_index.clone()));
Review Comment:
fixed in
https://github.com/apache/arrow-rs/pull/10842/commits/3e382e5d63d12bbfa90bb84ef7f09cd9cdb8e648
I did some manual accounting. For an unpopulated index, the size should go
from the size of an `Option<PageIndex> 48 bytes` to `Option<Arc<...>> 16 bytes`
so a net -32 bytes.
For a populated index, we need to add in the heap size of the index (450
bytes), the size of the now heap allocated `PageIndex` (48 bytes), plus 16
bytes of heap allocated `Arc` overhead. This adds 64 bytes to the heap size,
but we saved 32 above, so we should net increase 32 bytes for the test case.
--
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]