1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! Run-length encoded sequences over Apache Arrow arrays.
//!
//! This crate builds on [`runlength`] and uses its plans and merge rules, but
//! stores values as an Arrow array, so values can be of any Arrow type:
//! numbers, strings, dictionaries, lists, structs, and nulls in any of them.
//!
//! * Combining sequences gathers values through a [`runlength::Plan`] and
//! applies any Arrow kernel ([`kernels`] has the usual ones).
//! * Merging uses the same rule as the core crate for every type
//! ([`identical_neighbours`]).
//! * [`ArrowRleBatch`] keys sequences by a table of key columns of any
//! types, and converts to one long table for polars or pandas.
//!
//! ```
//! use std::sync::Arc;
//! use arrow_array::{ArrayRef, StringArray};
//! use runlength_arrow::{ArrowRle, kernels};
//!
//! let names: ArrayRef = Arc::new(StringArray::from(vec!["a", "a", "b", "c", "c"]));
//! let rle = ArrowRle::from_dense(names).unwrap();
//! assert_eq!(rle.runs(), vec![2, 1, 2]);
//!
//! let other: ArrayRef = Arc::new(StringArray::from(vec!["a", "x", "c", "c", "c"]));
//! let other = ArrowRle::from_dense(other).unwrap();
//! let same = rle.zip_with(&other, None, None, kernels::eq).unwrap();
//! assert_eq!(same.runs(), vec![1, 2, 2]);
//! ```
pub use ArrowRleBatch;
pub use ;
pub use ;
pub use identical_neighbours;
pub use common_numeric_type;
pub use ;
pub use ;
pub use SliceAgg;
pub use ;