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

   # Which issue does this PR close?
   
   - Closes #11008.
   
   # Rationale for this change
   
   The Arrow spec allows sparse unions to contain arbitrary values in 
"unselected" children:
   
   > Only the slot in the array corresponding to the type index is considered. 
All "unselected" values are ignored and could be any semantically correct array 
value.
   
   Array equality for sparse unions (`ArrayData::eq`) compares every child 
array over the full slot range, regardless of which child each slot's type id 
selects. This is inconsistent with the spec, as well as the Arrow C++ 
implementation.
   
   # What changes are included in this PR?
   
   * Fix equality semantics for sparse unions
   * Add unit tests
   
   # Are these changes tested?
   
   Yes, new tests added.
   
   # Are there any user-facing changes?
   
   Yes, equality semantics for sparse unions have changed. However, it is 
pretty unlikely that user code would depend on the previous behavior (if 
anything, it would probably result in bugs in user code).
   
   # AI usage
   
   Developed with Claude Code Fable 5.1. I reviewed and revised the resulting 
code.


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