Merged
Conversation
Signed-off-by: tison <wander4096@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements CpcWrapper, a lightweight read-only view for extracting cardinality estimates from serialized CpcSketch data without performing full deserialization. This addresses issue #99 and aligns with similar implementations in the Go and Java DataSketches libraries.
Changes:
- Adds
CpcWrapperstruct that parses only the preamble from serialized CPC sketches to extract estimation parameters - Refactors estimation logic from
CpcSketchinto shared functions in the estimator module for code reuse - Extracts serialization constants and utilities into a dedicated serialization module
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| datasketches/src/cpc/wrapper.rs | Implements CpcWrapper with preamble-only parsing and estimation methods |
| datasketches/src/cpc/serialization.rs | Extracts shared serialization constants (flags, version) and preamble calculation function |
| datasketches/src/cpc/estimator.rs | Adds estimate/lower_bound/upper_bound wrapper functions and makes internal functions private |
| datasketches/src/cpc/sketch.rs | Refactors to use shared estimator and serialization utilities |
| datasketches/src/cpc/mod.rs | Adds serialization and wrapper modules, exports CpcWrapper |
| datasketches/tests/cpc_wrapper_test.rs | Tests wrapper functionality with HIP and ICON modes, error handling |
| CHANGELOG.md | Documents new CpcWrapper feature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: tison <wander4096@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This closes #99.