mkleen commented on code in PR #19599:
URL: https://github.com/apache/datafusion/pull/19599#discussion_r2658432663


##########
datafusion/common/src/stats.rs:
##########
@@ -321,6 +321,13 @@ impl Statistics {
         }
     }
 
+    /// Returns the memory size in bytes.
+    pub fn heap_size(&self) -> usize {
+        // column_statistics + num_rows + total_byte_size
+        self.column_statistics.capacity() * size_of::<ColumnStatistics>()

Review Comment:
   I am just reading through the docs.
   
   https://crates.io/crates/get-size2
   
   ```
   Note that the helpers are currently only available for regular structs, that 
is they do neither support tuple structs nor enums.
   ```
   
   We need enum support in this case, so I don't think this will work out of 
the box.



##########
datafusion/common/src/stats.rs:
##########
@@ -321,6 +321,13 @@ impl Statistics {
         }
     }
 
+    /// Returns the memory size in bytes.
+    pub fn heap_size(&self) -> usize {
+        // column_statistics + num_rows + total_byte_size
+        self.column_statistics.capacity() * size_of::<ColumnStatistics>()

Review Comment:
   I am just reading through the docs.
   
   https://crates.io/crates/get-size2
   
   ```
   Note that the helpers are currently only available for regular structs, that 
is they do neither support tuple structs nor enums.
   ```
   
   We need enum support in this case, so I don't think this will work out of 
the box.



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