Add value field accessors for list, fixedsizelist, listview, map & run arrays - #10661
Merged
Conversation
Mirrors ListArray::field for FixedSizeListArray, GenericListViewArray, MapArray (entries_field, ordered) and RunArray (run_ends_field, values_field). Also use FieldRef in ListArray::field's signature. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Rich-T-kid
approved these changes
Aug 12, 2026
Rich-T-kid
left a comment
Contributor
There was a problem hiding this comment.
@emilk makes sense to me, left a question for the REE methods
Comment on lines
+210
to
+215
| pub fn run_ends_field(&self) -> &FieldRef { | ||
| match &self.data_type { | ||
| DataType::RunEndEncoded(f, _) => f, | ||
| _ => unreachable!(), | ||
| } | ||
| } |
Contributor
There was a problem hiding this comment.
nit: what are your thoughts on returning both fields in one method and allowing callers to determine what they want to use?
Suggested change
| pub fn run_ends_field(&self) -> &FieldRef { | |
| match &self.data_type { | |
| DataType::RunEndEncoded(f, _) => f, | |
| _ => unreachable!(), | |
| } | |
| } | |
| pub fn run_end_fields(&self) -> (&FieldRef,&FieldRef) { | |
| match &self.data_type { | |
| DataType::RunEndEncoded(r, v) => (r,v), | |
| _ => unreachable!(), | |
| } | |
| } |
Contributor
Author
There was a problem hiding this comment.
The benefit of having two functions is that we have names for each of the fields, instead of relying on docs explaining which order they are returned in.
rerun-sync Bot
pushed a commit
to rerun-io/rerun
that referenced
this pull request
Aug 12, 2026
### Related * apache/arrow-rs#10661 ### What Adds `re_arrow_util::list_field(list_array) -> &Arc<Field>`, replacing the repeated ```rust let field = match column.list_array.data_type() { arrow::datatypes::DataType::List(field) => field.clone(), _ => unreachable!("This is always s list array"), }; ``` pattern. --------- Source-Ref: 30ea9420b5627637695ad3fe28780d0433c087c7 Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Jefffrey
reviewed
Aug 13, 2026
ListArray::field accessorListArray::value_field accessor
Jefffrey
approved these changes
Aug 14, 2026
Contributor
|
thanks @emilk & @Rich-T-kid |
ListArray::value_field accessor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
None
Rationale for this change
Given a
ListArrayI want to easily answer questions like "is the field nullable?" and "what is the underlying data type?". Now we can!Same for other arrays (
FixedSizeListArrayetc)What changes are included in this PR?
ListArray::value_field()FixedSizeListArray::value_field()GenericListViewArray::value_field() (ListView + LargeListView)MapArray::entries_field(), MapArray::ordered()RunArray::run_ends_field(), RunArray::values_field()Are these changes tested?
No
Are there any user-facing changes?
Yes