tustvold commented on code in PR #1816:
URL: https://github.com/apache/arrow-rs/pull/1816#discussion_r891572330
##########
arrow/src/array/data.rs:
##########
@@ -819,12 +826,12 @@ impl ArrayData {
match &self.data_type {
DataType::List(field) | DataType::Map(field, _) => {
let values_data =
self.get_single_valid_child_data(field.data_type())?;
- self.validate_offsets::<i32>(&self.buffers[0],
values_data.len)?;
+ self.validate_offsets::<i32>(values_data.len)?;
Review Comment:
This is the fix for #1814
##########
arrow/src/array/data.rs:
##########
@@ -1000,17 +1007,9 @@ impl ArrayData {
pub fn validate_dictionary_offset(&self) -> Result<()> {
match &self.data_type {
DataType::Decimal(p, _) => {
- let values_buffer = &self.buffers[0];
-
- for pos in 0..values_buffer.len() {
- let raw_val = unsafe {
- std::slice::from_raw_parts(
- values_buffer.as_ptr().add(pos),
- 16_usize,
- )
- };
- let value =
i128::from_le_bytes(raw_val.try_into().unwrap());
- validate_decimal_precision(value, *p)?;
+ let values_buffer: &[i128] = self.typed_buffer(0, self.len)?;
Review Comment:
This is the fix for #1813
--
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]