neilconway opened a new pull request, #22911:
URL: https://github.com/apache/datafusion/pull/22911

   ## Which issue does this PR close?
   
   - Closes #22910
   
   ## Rationale for this change
   
   ArrayMap bucket lookups computed `key.wrapping_sub(offset) as usize`, and 
then bounds-checked the result after the cast. On 64-bit hosts, that is fine, 
but on 32-bit hosts, the cast will truncate the computed bucket offset to its 
low 32 bits. Given a large probe key whose low 32 bits are a valid bucket array 
index, this can produce incorrect results.
   
   ## What changes are included in this PR?
   
   * Introduce `key_to_index` and `key_present` helpers, so consolidate bucket 
lookup logic into one place
   * Fix bucket lookup logic for 32-bit hosts
   * Add unit test
   
   ## Are these changes tested?
   
   Yes; new test added.
   
   ## Are there any user-facing changes?
   
   No.
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to