Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance ListViewArray related docs #7007

Merged
merged 2 commits into from
Jan 24, 2025
Merged

Conversation

Jefffrey
Copy link
Contributor

Whilst reviewing #6969 I noticed the docs for GenericListViewArray weren't as detailed compared to GenericListArray. Just enhancing the docs a bit, borrowing the example from GenericListArray to give a visual representation of how view differs from regular list layout.

Also update the datatype docs to remove the reference to internal buffers as that would belong with the GenericListViewArray doc instead of at datatype level.

@github-actions github-actions bot added the arrow Changes to the arrow crate label Jan 22, 2025
///
/// [Variable-size List Layout: ListView Layout]: https://arrow.apache.org/docs/format/Columnar.html#listview-layout
/// This allows the offsets (and subsequently child data) to be out of order. It also
/// allows take / filter operations to be implemented without copying the underlying data.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to elaborate on this statement about take / filter operations efficiency; I just kept it verbatim as it was already there before.

/// ├─────────────┤ ├───────┤ │ ├───┤ ├───┤ ├───┤ ├───┤ ├───┤
/// │ NULL │ │ (?,?) │ │ 0 │ │ ? │ │ ? │ │ │ 1 │ │ C │ │ 2 │
/// ├─────────────┤ ├───────┤ │ ├───┤ ├───┤ ├───┤ ├───┤ ├───┤
/// │ [D] │ │ (4,1) │ │ 1 │ │ 4 │ │ 1 │ │ │ ? │ │ ? │ │ 3 │
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically you don't need a value at index 3, list view even allows for overlapping ranges

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added another example which shows this in use 👍

/// This allows the offsets (and subsequently child data) to be out of order. It also
/// allows take / filter operations to be implemented without copying the underlying data.
///
/// # Representation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

@Jefffrey Jefffrey merged commit 0c07ec7 into apache:main Jan 24, 2025
26 checks passed
@Jefffrey Jefffrey deleted the listview-doc branch January 24, 2025 13:57
@alamb alamb added the documentation Improvements or additions to documentation label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants