Function smartnoise_runtime::components::count::count_distinct [−][src]
pub fn count_distinct<T: Eq + Hash>(data: &ArrayD<T>) -> Result<ArrayD<Integer>>
Gets number of unique values in the data.
Arguments
data
- Data for which you want a distinct count.
Return
Number of rows in data.
Example
use ndarray::{ArrayD, arr1, arr2}; use smartnoise_runtime::components::count::count_distinct; let data = arr2(&[ [false, false, true], [true, false, true] ]).into_dyn(); let distinct = count_distinct(&data).unwrap(); assert_eq!(distinct, arr2(&[ [2, 1, 1] ]).into_dyn());