polars_arrow::compute::aggregate

Function estimated_bytes_size

Source
pub fn estimated_bytes_size(array: &dyn Array) -> usize
Available on crate feature compute_aggregate only.
Expand description

Returns the total (heap) allocated size of the array in bytes.

§Implementation

This estimation is the sum of the size of its buffers, validity, including nested arrays. Multiple arrays may share buffers and bitmaps. Therefore, the size of 2 arrays is not the sum of the sizes computed from this function. In particular, StructArray’s size is an upper bound.

When an array is sliced, its allocated size remains constant because the buffer unchanged. However, this function will yield a smaller number. This is because this function returns the visible size of the buffer, not its total capacity.

FFI buffers are included in this estimation.