scovich commented on PR #8611:
URL: https://github.com/apache/arrow-rs/pull/8611#issuecomment-3403413110

   > > One question: Are there any existing places in the code that would 
benefit from this new capability? If so, we might want to consider updating 
them so we get code coverage right away.
   > 
   > I'm not too sure, I added an example of `extend` that should come up in a 
doc test, plus a couple more unit tests
   
   A quick code search turns up two candidates:
   * benches/variant_kernels.rs, `create_primitive_variant_array` - it 
currently does something very inefficient (fortunately outside the actual 
benchmarking loop) and could be simplified to just:
       ```rust
       variant_builder.extend(std::iter::repeat_with(|| 
rng.random::<i64>()).take(size))
       ```
       (this assumes you update the impl to take `V: Into<Variant>` instead of 
`Variant`, see other comment.
   * src/shred_variant.rs, the loop in `create_test_variant_array` can be 
replaced with an `extend` call 
   (could also consider adding implementations of `From` or `FromIter` for 
`VariantArray`, to avoid the new+extend+build triple that seems to show up a 
lot?) 
   
   > Hi @scovich, long time no talk!
   
   Howdy! 👋 


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