mikamikasuki opened a new pull request, #11367:
URL: https://github.com/apache/arrow-rs/pull/11367

   # Which issue does this PR close?
   
   - Relates to #6528.
   
   # Rationale for this change
   
   Applying another validity mask currently requires rebuilding an array from 
its buffers. Replacing a null buffer can expose slots that were previously 
null, including values that do not satisfy an array type's invariants. A safe 
helper should preserve existing nulls.
   
   # What changes are included in this PR?
   
   Adds `with_additional_nulls` to `PrimitiveArray`, `BooleanArray`, and 
`GenericByteArray`; it unions the supplied mask with existing nulls. Adds 
`with_nulls_unchecked` for exact replacement when the caller upholds the 
documented safety requirements.
   
   # Are these changes tested?
   
   Unit tests cover mask union, exact replacement, and length mismatches. The 
`arrow-array` package tests pass with `force_validate`, and Clippy passes for 
all `arrow-array` targets with warnings denied.
   
   # Are there any significant user-facing changes?
   
   This adds public null-buffer helpers to three array types. The safe method 
only adds nulls; replacing the mask exactly remains an explicitly unsafe 
operation.
   
   AI generated the implementation and tests; the contributor reviewed the 
changes.


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