viirya commented on code in PR #3529:
URL: https://github.com/apache/arrow-rs/pull/3529#discussion_r1070363121
##########
arrow-data/src/data.rs:
##########
@@ -245,18 +245,58 @@ pub(crate) fn into_buffers(
/// An generic representation of Arrow array data which encapsulates common
attributes and
/// operations for Arrow array. Specific operations for different arrays types
(e.g.,
/// primitive, list, struct) are implemented in `Array`.
+///
+/// # Memory Layout
+///
+/// `ArrayData` has references to one or more underlying data buffers
+/// and optional child ArrayDatas, depending on type as illustrated
+/// below. Bitmaps are not shown for similicity but they are stored
+/// similiarly to the buffers.
+///
+/// ```text
+/// offset
+/// points to
+/// ┌───────────────────┐ start of ┌───────┐ Different
+/// │ │ data │ │ ArrayData may
+/// │ArrayData { │ │.... │ also refer to
+/// │ data_type: ... │ ─ ─ ─ ─▶│1234 │ ┌ ─ the same
+/// │ offset: ... ─ ─ ─│─ ┘ │4372 │ underlying
+/// │ len: ... ─ ─ ─│─ ┐ │4888 │ │ buffer
Review Comment:
```suggestion
/// points to
/// ┌───────────────────┐ start of ┌───────┐ Different
/// │ │ data │ │ ArrayData may
/// │ArrayData { │ │.... │ also refer to
/// │ data_type: ... │ ─ ─ ─ ─▶│1234 │ ┌ ─ the same
/// │ offset: ... ─ ─ ─│─ ┘ │4372 │ underlying
/// │ len: ... ─ ─ ─│─ ┐ │4888 │ │ buffer with different
offset/len
```
--
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]