HyukjinKwon opened a new pull request, #48798:
URL: https://github.com/apache/arrow/pull/48798

   ### Rationale for this change
   
   Fixed-size list scalars with equal values but different offsets were hashing 
to different values, violating the hash-equality contract.
   
   ### What changes are included in this PR?
   
   - Added `FIXED_SIZE_LIST` case in `ArrayHash` to scale child offsets by 
`list_size`
   - Added C++ test in `scalar_test.cc` for nested fixed-size lists
   - Added Python test in `test_scalars.py`
   
   ### Are these changes tested?
   
   Unit tests were added, and also manually tested.
   
   ### Are there any user-facing changes?
   
   Yes.
   
   ```python
   import pyarrow as pa
   
   inner = pa.list_(pa.int32(), 2)
   outer = pa.list_(inner, 3)
   g = pa.array([[[1, 2], [3, 4], [5, 6]], [[7, 8], [9, 10], [11, 12]]], 
type=outer)
   h = pa.array([[[7, 8], [9, 10], [11, 12]]], type=outer)
   # Comparing `[[7, 8], [9, 10], [11, 12]]`
   print(g[1] == h[0])
   print(hash(g[1]) == hash(h[0]))
   ```
   
   Before:
   
   ```
   True
   False
   ```
   
   After:
   
   ```
   True
   True
   ```


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