tustvold commented on code in PR #2383:
URL: https://github.com/apache/arrow-rs/pull/2383#discussion_r941070788
##########
arrow/src/array/array_decimal.rs:
##########
@@ -242,22 +245,57 @@ pub trait BasicDecimalArray<T: BasicDecimal, U:
From<ArrayData>>:
.offset(list_offset);
let array_data = unsafe { builder.build_unchecked() };
- U::from(array_data)
+ Self::from(array_data)
}
/// The default precision and scale used when not specified.
- fn default_type() -> DataType {
+ pub const fn default_type() -> DataType {
Self::DEFAULT_TYPE
}
+ fn raw_value_data_ptr(&self) -> *const u8 {
+ self.value_data.as_ptr()
+ }
+}
+
+impl Decimal128Array {
+ /// Creates a [Decimal128Array] with default precision and scale,
+ /// based on an iterator of `i128` values without nulls
+ pub fn from_iter_values<I: IntoIterator<Item = i128>>(iter: I) -> Self {
Review Comment:
For the record this method is unsound, but was unsound before. There is a
broader issue here
--
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]