Tpt commented on PR #10400:
URL: https://github.com/apache/arrow-rs/pull/10400#issuecomment-5069761509

   > however if there is a separate need for these new From API implementations 
then theres more rationale for this change
   
   Yes, it make this work:
   ```rust
       #[test]
       fn test123() {
           let _ = create_array!(Binary, [Some(b"foo"), None]);
       }
   ```
   
   With the current macro definition, it will expand to 
`BinaryArray::from_vec(vec![Some(b"foo")])` that will fail to compile because 
`from_vec` expect a `Vec<&u8>`. Hence the need of some dynamic dispatch to call 
either `from_vec` or `from_opt_vec` depending on the input type, dispatch that 
`From` provides. Note that other datatype (`StringArray`...) already rely on it 
to provide `Option` support (e.g. `&str` vs `Option<&str>`).
   
   Sorry for so many back and force, please close if you still disagree and I 
will open an MR for `BinaryView`


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