Expand description
§Sorting Algorithms Kernels Module - Array Sorting and Ordering Operations
Sorting kernels for ordering operations across Arrow-compatible data types with null-aware semantics and optimised comparison strategies. Essential foundation for analytical operations requiring ordered data access and ranking computations.
Regular sorts here alter the actual data. The argsort variants return the indices.
Structs§
- Argsort
Config - Configuration for argsort with algorithm selection
Enums§
- Sort
Algorithm - Sort algorithm selection for argsort operations
Functions§
- argsort
- Comparison-based argsort for any Ord type - returns indices that would sort the data
- argsort_
auto_ i32 - Argsort for i32 with automatic algorithm selection
- argsort_
auto_ i64 - Argsort for i64 with automatic algorithm selection
- argsort_
auto_ u32 - Argsort for u32 with automatic algorithm selection
- argsort_
auto_ u64 - Argsort for u64 with automatic algorithm selection
- argsort_
boolean - Argsort for boolean arrays - false sorts before true
- argsort_
categorical_ custom - Argsort for CategoricalArray with custom category order
- argsort_
categorical_ lexical - Argsort for CategoricalArray - lexical ordering by string values
- argsort_
float - Argsort for floats with proper NaN handling
- argsort_
radix_ i32 - LSD Radix argsort for i32 - uses sign-bit flipping for proper signed ordering
- argsort_
radix_ i64 - LSD Radix argsort for i64 - uses sign-bit flipping for proper signed ordering
- argsort_
radix_ u32 - LSD Radix argsort for u32 - O(n·k) where k=4 (bytes)
- argsort_
radix_ u64 - LSD Radix argsort for u64 - O(n·k) where k=8 (bytes)
- argsort_
str - Argsort for string slices - returns indices that would sort the data lexicographically
- argsort_
string_ array - Argsort for StringArray (offset-based string storage)
- sort_
boolean_ array - Sorts a BooleanArray in-place by value: all false first, then true. Nulls sort first if present.
- sort_
categorical_ lexical - Sorts a CategoricalArray lexically by its unique values, returning new indices and mask. The category dictionary is preserved. Nulls sort first.
- sort_
float - Total ordering for f32/f64 as per IEEE 754
- sort_
int - Performs in-place unstable sorting of integer slices with optimal performance.
- sort_
slice_ with_ mask - Sorts array data and applies the same permutation to the null mask.
- sort_
str - Performs in-place unstable sorting of string slice references with lexicographic ordering.
- sort_
string_ array - For StringArray as contiguous utf8 buffer plus offsets. Assumes offsets + values as in minarrow StringArray.
- sorted_
float - Returns a newly sorted Vec64, leaving the original slice untouched.
- sorted_
int - Creates a new sorted copy of integer data in a Vec64 container.
- sorted_
str - Creates a new sorted collection of owned strings from string references.
- total_
cmp_ f - TLDR: Instead of comparing the raw bit patterns directly (which places all negative‐sign bit values after the positives), we transform each bit pattern into a “sort key”: => If the sign bit is 1 (negative or negative‐NaN), we invert all bits: !bits. => Otherwise (sign bit 0), we flip only the sign bit: bits ^ 0x80…0.