jamescorbett opened a new issue #1390:
URL: https://github.com/apache/arrow-rs/issues/1390


   **Describe the bug**
   
   try_from_sparse_iter expects at least one item to have Some to determine the 
size. This is a bad assumption as it may recieve all Nones. 
   
   InvalidArgumentError("column types must match schema types, expected 
FixedSizeBinary(32) but found FixedSizeBinary(0) at column index 0"
   
   **To Reproduce**
   
   `
           let none_option: Option<[u8; 32]> = None;
           let item = arrow::array::FixedSizeBinaryArray::try_from_sparse_iter(
               vec![none_option, none_option, none_option].into_iter(),
           )
           .unwrap();
          let rb = arrow::record_batch::RecordBatch::try_new(
               arrow_schema.clone(),
               vec![std::sync::Arc::new(item)],
           )
           .unwrap();
   
   `
   
   **Expected behavior**
   
   A record batch with a colum of all nulls.
   
   **Additional context**
   
   I would suggest fixing it by changing the behaviour of defaulting in 
**array_binary.rs**
   
   `
   let size = size.unwrap_or(0);
   `
   
   or changing the schema validation to handle a 0 size if the array is empty.


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