Add backend abstraction for sketch implementations#207
Merged
milindsrivastava1997 merged 4 commits intomainfrom Mar 20, 2026
Merged
Add backend abstraction for sketch implementations#207milindsrivastava1997 merged 4 commits intomainfrom
milindsrivastava1997 merged 4 commits intomainfrom
Conversation
milindsrivastava1997
requested changes
Mar 19, 2026
Contributor
milindsrivastava1997
left a comment
There was a problem hiding this comment.
CI is failing. Apart from this, and the one comment, LGTM
ef13416 to
c8f3b9e
Compare
…P/ASAPQuery into sketchlib-backend-abstraction
milindsrivastava1997
approved these changes
Mar 20, 2026
GnaneshGnani
added a commit
that referenced
this pull request
Mar 20, 2026
- Merged latest main (includes backend abstraction from PR #207) - Set Count-Min Sketch to use sketchlib backend by default - Keep KLL and Count-Min-With-Heap in legacy mode (not yet implemented) - UDFs already correctly configured: CMS uses sketchlib
GnaneshGnani
added a commit
that referenced
this pull request
Mar 20, 2026
- Merged latest main (includes backend abstraction from PR #207) - Set Count-Min Sketch to use sketchlib backend by default - Set Count-Min-With-Heap to use sketchlib backend by default - Keep KLL in legacy mode (not yet implemented) - UDFs correctly configured: CMS and CMWH use sketchlib
GnaneshGnani
added a commit
that referenced
this pull request
Mar 20, 2026
- Merged latest main (includes backend abstraction from PR #207) - Set all sketch backends to use sketchlib by default - Count-Min, Count-Min-With-Heap, and KLL all use sketchlib - UDFs correctly configured: all use sketchlib
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.
Summary
Introduces the backend abstraction layer (
ImplMode) that enables switching between legacy hand-written sketch implementations and future sketchlib-rust backends. This PR adds the configuration infrastructure without yet integrating sketchlib-rust.Changes
New Files
asap-common/sketch-core/src/config.rsImplModeenum withLegacyandSketchlibvariantsOnceLock-based global configuration for three sketch types:configure()function to set backends once at process startupuse_sketchlib_for_count_min(),use_sketchlib_for_kll(),use_sketchlib_for_count_min_with_heap()force_legacy_mode_for_tests()helper for test environmentsasap-query-engine/tests/test_both_backends.rscargo test -p query_engine_rust, tests run with Legacy by default--features sketchlib-teststo exercise Sketchlib modeasap-common/sketch-core/src/bin/sketchlib_fidelity.rsasap-common/sketch-core/report.mdModified Files
asap-common/sketch-core/src/lib.rspub mod config;asap-common/sketch-core/Cargo.tomlclapfor CLI parsing in the fidelity binaryctordev dependency for test initializationasap-query-engine/src/main.rs--sketch-cms-impl: Backend for Count-Min Sketch (default: sketchlib)--sketch-kll-impl: Backend for KLL Sketch (default: sketchlib)--sketch-cmwh-impl: Backend for Count-Min-With-Heap (default: sketchlib)config::configure()at startup before any sketch operationsasap-query-engine/src/lib.rssketchlib-testsfeatureasap-query-engine/Cargo.tomlsketchlib-testsfeature flagctordev dependency for test initializationTechnical Approach
sketchlib-testsfeature allows testing both backends in a singlecargo testinvocationTesting