34 releases (major breaking)

54.0.0 Dec 23, 2024
53.4.0 Jan 18, 2025
53.3.0 Nov 20, 2024
52.2.0 Jul 28, 2024
29.0.0 Dec 12, 2022

#223 in Data structures

Download history 298634/week @ 2024-10-08 286092/week @ 2024-10-15 363596/week @ 2024-10-22 312562/week @ 2024-10-29 286100/week @ 2024-11-05 268737/week @ 2024-11-12 263049/week @ 2024-11-19 161242/week @ 2024-11-26 219036/week @ 2024-12-03 271578/week @ 2024-12-10 221622/week @ 2024-12-17 94959/week @ 2024-12-24 166327/week @ 2024-12-31 289695/week @ 2025-01-07 277101/week @ 2025-01-14 211840/week @ 2025-01-21

964,019 downloads per month
Used in 486 crates (18 directly)

Apache-2.0

2.5MB
53K SLoC

Arrow ordering kernels

Sort RecordBatch

#
let a: ArrayRef = Arc::new(Int32Array::from(vec![1, 2, 3, 4]));
let b: ArrayRef = Arc::new(StringArray::from(vec!["b", "a", "e", "d"]));
let batch = RecordBatch::try_from_iter(vec![("a", a), ("b", b)]).unwrap();

// Sort by column 1
let indices = sort_to_indices(batch.column(1), None, None).unwrap();

// Apply indices to batch columns
let columns = batch.columns().iter().map(|c| take(&*c, &indices, None).unwrap()).collect();
let sorted = RecordBatch::try_new(batch.schema(), columns).unwrap();

let col1 = sorted.column(0).as_primitive::<Int32Type>();
assert_eq!(col1.values(), &[2, 1, 4, 3]);

Dependencies

~3.5–9MB
~77K SLoC