sdf-jkl commented on code in PR #9791:
URL: https://github.com/apache/arrow-rs/pull/9791#discussion_r3126809417
##########
parquet-variant-compute/src/unshred_variant.rs:
##########
@@ -394,13 +405,13 @@ macro_rules! handle_unshredded_case {
}
/// Generic unshred builder that works with any Array implementing
AppendToVariantBuilder
-struct UnshredPrimitiveRowBuilder<'a, T> {
- value: Option<&'a ArrayRef>,
- typed_value: &'a T,
+struct UnshredPrimitiveRowBuilder<T> {
+ value: Option<ArrayRef>,
+ typed_value: T,
Review Comment:
Can't keep the reference without using lifetimes in builders. It seems like
removing them was a bad idea. I'll switch it back.
##########
parquet-variant-compute/src/unshred_variant.rs:
##########
@@ -203,13 +201,25 @@ impl<'a> UnshredVariantRowBuilder<'a> {
DataType::Float32 => primitive_builder!(PrimitiveFloat32,
as_primitive),
DataType::Float64 => primitive_builder!(PrimitiveFloat64,
as_primitive),
DataType::Decimal32(p, s) if
VariantDecimal4::is_valid_precision_and_scale(p, s) => {
- Self::Decimal32(DecimalUnshredRowBuilder::new(value,
typed_value, *s as _))
+ Self::Decimal32(DecimalUnshredRowBuilder::new(
+ value,
+ typed_value.as_primitive().clone(),
Review Comment:
We're cloning a `&PrimitiveArray<T>`
```rust
pub struct PrimitiveArray<T: ArrowPrimitiveType> {
data_type: DataType, // 24 bytes
/// Values data
values: ScalarBuffer<T::Native>, // 24 bytes
nulls: Option<NullBuffer>, // 48 bytes if Some
}
```
--
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]