-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use search_sorted_usize when searching for indices (#1566)
Originally found in a CI failure: https://github.com/spiraldb/vortex/actions/runs/12170181872/job/33944625544?pr=1528 Brief description: Let's imagine you have the following SparseArray ``` SparseArray(len=1000, indices=[2], values=[2]) ``` If you `slice(array, 2, 1000)` then you end up where the end of the slice exceeds the `ptype` of the indices array (after the changes for `downcast_integer_array` went in earlier) and this would cause a failure. The fix is to use search_sorted_usize so that rather than casting the scalar to the ptype of the array, we cast the array values up to `usize` for comparison Added a minimal test and verified it fails before the change: ![image](https://github.com/user-attachments/assets/0131b0e1-9f07-4e88-8774-1d4fbf111c1a)
- Loading branch information
Showing
7 changed files
with
42 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters