-
Notifications
You must be signed in to change notification settings - Fork 874
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
Add MapArray constructors and doc example #4382
Conversation
140cd9b
to
e3fc71a
Compare
arrow-array/src/array/list_array.rs
Outdated
@@ -103,7 +104,7 @@ impl<OffsetSize: OffsetSizeTrait> GenericListArray<OffsetSize> { | |||
let len = offsets.len() - 1; // Offsets guaranteed to not be empty | |||
let end_offset = offsets.last().unwrap().as_usize(); | |||
// don't need to check other values of `offsets` because they are checked | |||
// during construction of `OffsetsbBuffer` | |||
// during construction of `OffsetsBuffer` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// during construction of `OffsetsBuffer` | |
// during construction of `OffsetBuffer` |
arrow-array/src/array/map_array.rs
Outdated
} | ||
if field.is_nullable() || entries.null_count() != 0 { | ||
return Err(ArrowError::InvalidArgumentError( | ||
"MapArray entries cannot contain be null".to_string(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"MapArray entries cannot contain be null".to_string(), | |
"MapArray entries cannot contain null".to_string(), |
arrow-array/src/array/map_array.rs
Outdated
let len = offsets.len() - 1; // Offsets guaranteed to not be empty | ||
let end_offset = offsets.last().unwrap().as_usize(); | ||
// don't need to check other values of `offsets` because they are checked | ||
// during construction of `OffsetsBuffer` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// during construction of `OffsetsBuffer` | |
// during construction of `OffsetBuffer` |
030a38c
to
d52e101
Compare
/// [`MapArray`] is physically a [`ListArray`] of key values pairs stored as an `entries` | ||
/// [`StructArray`] with 2 child fields. | ||
/// | ||
/// See [`MapBuilder`](crate::builder::MapBuilder) for how to construct a [`MapArray`] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see a compelling reason to duplicate the example already on MapBuilder
Which issue does this PR close?
Closes #4385
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?