Yifeng-Sigma commented on issue #5352:
URL: https://github.com/apache/arrow-rs/issues/5352#issuecomment-1920319745

   > There is 
https://docs.rs/arrow-data/latest/arrow_data/struct.ArrayData.html#method.get_slice_memory_size
 but if you're only interested in strings you could do something like
   > 
   > ```
   > let offsets = array.offsets();
   > let total_length = offsets.last().unwrap().as_usize() - 
offsets.first().unwrap().as_usize();
   > ```
   > 
   > I should highlight that this will ignore the overheads from encoding field 
names in JSON though, and will be a pretty crude approximation.
   
   We are interested in types other than string as well. 
get_slice_memory_size() is exactly what I'm looking for! 
   Seems only `get_buffer_memory_size()` and `get_array_memory_size` are 
implemented for array, but get_slice_memory_size() is implemented for 
`ArrayData` only, wondering what's the recommendation for array here?
   


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