carpecodeum commented on code in PR #7965: URL: https://github.com/apache/arrow-rs/pull/7965#discussion_r2218140366
########## parquet-variant-compute/src/variant_array_builder.rs: ########## @@ -146,7 +146,7 @@ impl VariantArrayBuilder { } /// Append the [`Variant`] to the builder as the next row - pub fn append_variant(&mut self, variant: Variant) { + pub fn append_variant<'m, 'v>(&mut self, variant: impl Into<Variant<'m, 'v>>) { // TODO make this more efficient by avoiding the intermediate buffers Review Comment: something like ``` pub fn append_variant<'m, 'v>(&mut self, variant: impl Into<Variant<'m, 'v>>) { let variant = variant.into(); match variant { Variant::Int32(v) => self.append_int32(v), Variant::String(v) => self.append_string(v), Variant::Object(obj) => { // Build object directly into our buffers without intermediate VariantBuilder self.append_object_start(); for field in obj.iter() { self.append_variant(field.value()); // recursive } self.append_object_end(); } // ... other variants } } ``` -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org