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.
Functions§
- 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.