scovich commented on code in PR #8611:
URL: https://github.com/apache/arrow-rs/pull/8611#discussion_r2430269935


##########
parquet-variant-compute/src/variant_array_builder.rs:
##########
@@ -162,6 +173,17 @@ impl VariantArrayBuilder {
     }
 }
 
+impl<'m, 'v> Extend<Option<Variant<'m, 'v>>> for VariantArrayBuilder {
+    fn extend<T: IntoIterator<Item = Option<Variant<'m, 'v>>>>(&mut self, 
iter: T) {

Review Comment:
   I just realized... we probably want two `impl Extend`:
   
   ```rust
   impl<'m, 'v, V: Into<Variant<'m, 'v>> Extend<V> for VariantArrayBuilder {
       fn extend<T: IntoIterator<Item = V>>(&mut self, iter: T) {
           for v in iter {
               self.append_variant(v.into())
           }
       }
   }
   ```
   and
   ```rust
   impl<'m, 'v, V: Into<Variant<'m, 'v>> Extend<Option<V>> for 
VariantArrayBuilder {
       fn extend<T: IntoIterator<Item = Option<V>>>(&mut self, iter: T) {
           for v in iter {
               match v {
                   Some(v) => self.append_variant(v.into()),
                   None => self.append_null(),
               }
           }
       }
   }
   ```
   
   I think that's typical for the other variant arrays, to capture both 
nullable and non-nullable data?



-- 
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]

Reply via email to