Decodes a `ArrayData` from rows based on the provided `FixedLengthEncoding` `T` # Safety `data_type` must be appropriate native type for `T`
(
rows: &mut [&[u8]],
data_type: DataType,
options: SortOptions,
)
| 434 | /// |
| 435 | /// `data_type` must be appropriate native type for `T` |
| 436 | unsafe fn decode_fixed<T: FixedLengthEncoding + ArrowNativeType>( |
| 437 | rows: &mut [&[u8]], |
| 438 | data_type: DataType, |
| 439 | options: SortOptions, |
| 440 | ) -> ArrayData { |
| 441 | let len = rows.len(); |
| 442 | |
| 443 | let mut values = BufferBuilder::<T>::new(len); |
| 444 | let (null_count, nulls) = decode_nulls(rows); |
| 445 | |
| 446 | for row in rows { |
| 447 | let i = split_off(row, T::ENCODED_LEN); |
| 448 | let value = T::Encoded::from_slice(&i[1..], options.descending); |
| 449 | values.append(T::decode(value)); |
| 450 | } |
| 451 | |
| 452 | let builder = ArrayDataBuilder::new(data_type) |
| 453 | .len(len) |
| 454 | .null_count(null_count) |
| 455 | .add_buffer(values.finish()) |
| 456 | .null_bit_buffer(Some(nulls)); |
| 457 | |
| 458 | // SAFETY: Buffers correct length |
| 459 | unsafe { builder.build_unchecked() } |
| 460 | } |
| 461 | |
| 462 | /// Decodes a `PrimitiveArray` from rows |
| 463 | pub fn decode_primitive<T: ArrowPrimitiveType>( |
nothing calls this directly
no test coverage detected