-
Notifications
You must be signed in to change notification settings - Fork 3
refactor(query-engine): remove obsolete heap top-k APIs and paths #685
Description
Parent
What to build
Consolidate the CountMinSketchWithHeap API and top-k execution path. The current implementation contains a compatibility re-export, an unimplemented deserialization method, multiple serialization paths, a dead formatting pipeline, and stale comments.
Coordinate with #673 for serialization behavior and #670 for the typed aggregation representation.
Acceptance criteria
- One supported heap serialization contract is clearly defined.
- Unimplemented or dead public APIs are removed, implemented, or explicitly deprecated.
- The heap-item public API has a stable name and ownership.
- Top-k sorting, formatting, and truncation have one authoritative execution path.
- Stale top-k comments and documentation are corrected.
- Existing compatibility requirements are covered by tests.
Blocked by
- Fail loudly when accumulator serialization fails #673 — serialization failures must be handled before removing or changing serialization APIs.
- refactor(asap-types): model aggregation kinds and subtypes with typed enums #670 — typed aggregation representation may define the final heap API boundary.
Concrete examples
The current public surface contains patterns like:
pub use asap_sketchlib::CmsHeapItem as HeapItemReexport; pub fn deserialize_from_bytes(...) -> Result<Self, Error> { Err("... not implemented".into()) }
The query engine also retains a dead-code-marked formatter while the active range pipeline performs top-k sorting and truncation elsewhere. In addition, SQL code still contains a comment equivalent to:
// SQL doesn't support topk limiting yeteven though the execution path supports heap-based top-k limiting.
The cleanup should leave one documented serialization contract and one authoritative top-k execution path.