jhorstmann opened a new issue, #4810:
URL: https://github.com/apache/arrow-rs/issues/4810

   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   <!--
   A clear and concise description of what the problem is. Ex. I'm always 
frustrated when [...] 
   (This section helps Arrow developers understand the context and *why* for 
this feature, in addition to  the *what*)
   -->
   
   Since the introduction of `BooleanBuffer` the validity and data buffers of 
an array could have differing offsets. For example the following test passes:
   
   ```
   let values = BooleanBuffer::from(vec![true, false, true, false]).slice(1, 3);
   let nulls = BooleanBuffer::from(vec![true, false, true, false, 
true]).slice(2, 3);
   
   let array = BooleanArray::new(values, Some(NullBuffer::new(nulls)));
   
   let data = array.into_data();
   assert_eq!(data.offset(), 1);
   assert_eq!(data.nulls().map(|n| n.offset()), Some(2));
   ```
   
   However there seems to be no constructor of `ArrayData` that allows creating 
such data directly. Both `try_new` and `new_unchecked` take an untyped `Buffer` 
for the `null_bit_buffer`.
   
   **Describe the solution you'd like**
   <!--
   A clear and concise description of what you want to happen.
   -->
   
   The `null_bit_buffer` parameter should be changed to be of type 
`Option<NullBuffer>`. This should also simplify some of the validation logic in 
`try_new` and allow to remove the `null_count` parameter from `new_unchecked`.
   
   **Describe alternatives you've considered**
   <!--
   A clear and concise description of any alternative solutions or features 
you've considered.
   -->
   
   The parameter could also be of type `Option<BooleanBuffer>` and keep the 
`null_count` parameter, but using `NullBuffer` is probably the better 
encapsulation.
   
   **Additional context**
   <!--
   Add any other context or screenshots about the feature request here.
   -->
   


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