From 79ea6ad89cdee81cab5fe54e4dcd22b0c26ea090 Mon Sep 17 00:00:00 2001 From: Yongting You <2010youy01@gmail.com> Date: Mon, 21 Oct 2024 20:31:09 +0800 Subject: [PATCH] Minor: more comments for `RecordBatch.get_array_memory_size()` (#6607) * doc RecordBatch size * Update arrow-array/src/record_batch.rs Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com> --------- Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com> --- arrow-array/src/record_batch.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arrow-array/src/record_batch.rs b/arrow-array/src/record_batch.rs index c56b1fd308cf..78108d441b05 100644 --- a/arrow-array/src/record_batch.rs +++ b/arrow-array/src/record_batch.rs @@ -469,6 +469,11 @@ impl RecordBatch { } /// Returns the total number of bytes of memory occupied physically by this batch. + /// + /// Note that this does not always correspond to the exact memory usage of a + /// `RecordBatch` (might overestimate), since multiple columns can share the same + /// buffers or slices thereof, the memory used by the shared buffers might be + /// counted multiple times. pub fn get_array_memory_size(&self) -> usize { self.columns() .iter()