Jefffrey commented on code in PR #9376:
URL: https://github.com/apache/arrow-rs/pull/9376#discussion_r2887706884
##########
arrow-array/src/array/run_array.rs:
##########
@@ -123,6 +123,28 @@ impl<R: RunEndIndexType> RunArray<R> {
Ok(array_data.into())
}
+ /// Create a new [`RunArray`] from the provided parts, without validation
+ ///
+ /// # Safety
+ ///
+ /// Safe if [`Self::try_new`] would not error
+ pub unsafe fn new_unchecked(
+ data_type: DataType,
+ run_ends: RunEndBuffer<R::Native>,
+ values: ArrayRef,
+ ) -> Self {
Review Comment:
It does feel like we should have some consistency to include this force
validate path, though it might need a bit of refactoring of the validate logic
in `try_new` to make it fit here 🤔
I think only union array is the other array type with new_unchecked that
doesn't have this force validate path:
https://github.com/apache/arrow-rs/blob/5ba451531efd2e98de38f6a8443aad605b6b5cc5/arrow-array/src/array/union_array.rs#L149-L172
All the others include it
--
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]