etseidl commented on code in PR #6244:
URL: https://github.com/apache/arrow-rs/pull/6244#discussion_r1715957595
##########
parquet/src/arrow/array_reader/fixed_len_byte_array.rs:
##########
@@ -165,57 +165,65 @@ impl ArrayReader for FixedLenByteArrayReader {
// TODO: An improvement might be to do this conversion on read
let array: ArrayRef = match &self.data_type {
ArrowType::Decimal128(p, s) => {
- let decimal = binary
- .iter()
- .map(|opt| Some(i128::from_be_bytes(sign_extend_be(opt?))))
- .collect::<Decimal128Array>()
+ let nulls = binary.nulls().cloned();
+ let decimal = binary.iter().map(|o| match o {
Review Comment:
Hmm, I seem to have reinvented `unary()` 😦 (Except here `F` is
`Fn(Option<T::Native>) -> O::Native`). Given we discard the array anyway, it
would be nice to have something like `unary` that consumes `self` so we can
just take the null buffer rather than cloning 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]