Dandandan commented on code in PR #9305:
URL: https://github.com/apache/arrow-rs/pull/9305#discussion_r2745030406
##########
arrow-array/src/array/primitive_array.rs:
##########
@@ -636,6 +636,22 @@ impl<T: ArrowPrimitiveType> PrimitiveArray<T> {
Self::try_new(values, nulls).unwrap()
}
+ /// Create a [`PrimitiveArray`] from the provided data type, values and
nulls
+ ///
+ /// panic's if the type is not compatible
+ pub(crate) fn new_with_datatype(
+ data_type: DataType,
+ values: ScalarBuffer<T::Native>,
+ nulls: Option<NullBuffer>,
+ ) -> Self {
+ Self::assert_compatible(&data_type);
Review Comment:
This does an extra check that wasn't there before when using
`build_unchecked`?
--
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]