This is an automated email from the ASF dual-hosted git repository. tisonkun pushed a commit to branch codex/kll-api-and-performance in repository https://gitbox.apache.org/repos/asf/datasketches-rust.git
commit 226a538b576e4c7993d1f684a9c72100566d17d4 Author: tison <[email protected]> AuthorDate: Wed Sep 2 12:22:27 2026 +0800 docs(kll): polish public query types --- datasketches/src/kll/sketch.rs | 3 ++- datasketches/src/kll/sorted_view.rs | 3 ++- datasketches/src/lib.rs | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/datasketches/src/kll/sketch.rs b/datasketches/src/kll/sketch.rs index 175e93a..ec62091 100644 --- a/datasketches/src/kll/sketch.rs +++ b/datasketches/src/kll/sketch.rs @@ -165,7 +165,8 @@ impl<T: Clone, C: KllComparator<T>> KllSketch<T, C> { /// Updates the sketch with a new item. /// - /// NaN values are ignored for floating-point types. + /// Values rejected by the configured comparator are ignored. This includes NaN values when + /// using [`NaturalOrder`]. /// /// # Panics /// diff --git a/datasketches/src/kll/sorted_view.rs b/datasketches/src/kll/sorted_view.rs index 2337a6c..cd5f662 100644 --- a/datasketches/src/kll/sorted_view.rs +++ b/datasketches/src/kll/sorted_view.rs @@ -18,6 +18,7 @@ use std::cmp::Ordering; use super::order::KllComparator; +use super::order::NaturalOrder; use crate::common::SearchCriteria; use crate::error::Error; @@ -26,7 +27,7 @@ use crate::error::Error; /// Build one with [`KllSketch::sorted_view`](super::KllSketch::sorted_view) when running repeated /// queries against the same sketch state. #[derive(Debug, Clone)] -pub struct SortedView<T: Clone, C: KllComparator<T>> { +pub struct SortedView<T: Clone, C: KllComparator<T> = NaturalOrder> { comparator: C, entries: Vec<Entry<T>>, total_weight: u64, diff --git a/datasketches/src/lib.rs b/datasketches/src/lib.rs index 3dac470..b4ff016 100644 --- a/datasketches/src/lib.rs +++ b/datasketches/src/lib.rs @@ -39,8 +39,9 @@ //! * Use `countmin` for point-frequency estimates and `frequencies` for discovering heavy hitters. //! * Use `hll` for fast distinct counts, `cpc` for compact serialized distinct counts, or `theta` //! when set operations are required. -//! * Use `req` or `tdigest` for ranks and quantiles. REQ targets configurable high- or low-rank -//! accuracy; T-Digest emphasizes distribution tails. +//! * Use `kll`, `req`, or `tdigest` for ranks and quantiles. KLL provides strong general-purpose +//! rank accuracy, REQ targets configurable high- or low-rank accuracy, and T-Digest emphasizes +//! distribution tails. //! * Use `tuple` when retained Theta keys need application-defined summaries. //! //! See each module's documentation for accuracy, memory, serialization, and update examples. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
