From c3bffcde12f0f4792a411a3aed5d78b5d833b8b6 Mon Sep 17 00:00:00 2001 From: Yongting You <2010youy01@gmail.com> Date: Mon, 21 Oct 2024 11:26:46 +0800 Subject: [PATCH 1/2] doc RecordBatch size --- arrow-array/src/record_batch.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arrow-array/src/record_batch.rs b/arrow-array/src/record_batch.rs index c56b1fd308cf..b153d146ce0b 100644 --- a/arrow-array/src/record_batch.rs +++ b/arrow-array/src/record_batch.rs @@ -469,6 +469,10 @@ 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 an + /// `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() From 2cc6d2c7a74b0deb688481b3c041fd150330fd0f Mon Sep 17 00:00:00 2001 From: Yongting You <2010youy01@gmail.com> Date: Mon, 21 Oct 2024 18:20:51 +0800 Subject: [PATCH 2/2] Update arrow-array/src/record_batch.rs Co-authored-by: Raphael Taylor-Davies <1781103+tustvold@users.noreply.github.com> --- arrow-array/src/record_batch.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arrow-array/src/record_batch.rs b/arrow-array/src/record_batch.rs index b153d146ce0b..78108d441b05 100644 --- a/arrow-array/src/record_batch.rs +++ b/arrow-array/src/record_batch.rs @@ -469,7 +469,8 @@ 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 an + /// + /// 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.