Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All significant changes to this project will be documented in this file.

### New features

* Use serial version 2 for new `CountMinSketch` instances, enabling cross-language interchange with the documented input encodings. New sketches support `1..=127` rows and require a version 2 reader. Existing version 1 data remains readable and updatable, but must be rebuilt from source items to merge with new sketches.
* Add `CpcUnion::serialize`, which produces the same bytes as `to_sketch().serialize()` and can be faster.
* Add `HllUnion::serialize` to serialize union results directly.
* Add `XorFilter` and `XorFilterBuilder` behind the `xor` feature for immutable membership queries on values or precomputed hashes. Filters support 8-, 16-, and 32-bit fingerprints and can be serialized for later queries.
Expand Down
14 changes: 8 additions & 6 deletions datasketches/src/countmin/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,19 @@
//! The CountMin sketch provides approximate frequency counts for streaming data
//! with configurable relative error and confidence bounds.
//!
//! Serial version 2 sketches with `i64` counters support cross-language binary interchange when
//! items use compatible hashing; see [`CountMinSketch`] and [`hash::value`](crate::hash::value).
//!
//! # Usage
//!
//! ```
//! use datasketches::countmin::CountMinSketch;
//! use datasketches::hash::value::raw_bytes;
//!
//! let mut sketch = CountMinSketch::<i64>::new(5, 256).unwrap();
//! sketch.update("apple");
//! sketch.update_with_weight("banana", 3);
//! assert!(sketch.estimate("banana") >= 3);
//! sketch.update(raw_bytes::from_str("apple"));
//! sketch.update_with_weight(raw_bytes::from_str("banana"), 3);
//! assert!(sketch.estimate(raw_bytes::from_str("banana")) >= 3);
//! ```
//!
//! # Configuration Helpers
Expand All @@ -39,11 +43,9 @@
//! let buckets = CountMinSketch::<i64>::suggest_num_buckets(0.01).unwrap();
//! let hashes = CountMinSketch::<i64>::suggest_num_hashes(0.99).unwrap();
//! let sketch = CountMinSketch::<i64>::new(hashes, buckets).unwrap();
//! assert_eq!(sketch.estimate("apple"), 0);
//! assert_eq!(sketch.estimate(1i64), 0);
//! ```

mod serialization;

mod sketch;
pub use self::sketch::CountMinSketch;

Expand Down
21 changes: 0 additions & 21 deletions datasketches/src/countmin/serialization.rs

This file was deleted.

Loading
Loading