Skip to content

Executor has no KMV kernel although Pass 1 offers KMV for distinct counts #697

Closed

Description

@zzylol

Problem

Pass 1 offers KMV as a distinct-count candidate (realization.rs summary_candidates), and Stage 3 prices it. But asap-physical-operators has no KMV kernel, so a selected plan that uses KMV can't execute. Found while building the family-capability table (#696).

Proposal

Add a KMV summary kernel that wraps asap_sketchlib's KMV (src/sketches/kmv.rs), never a local copy: build, merge and distinct-count estimate. KMV::merge keeps the k smallest distinct hashes, and every item is hashed with the shared CANONICAL_HASH_SEED, so merged states equal the union build (#696 records KMV as mergeable, overlap allowed).

#694 plans to make KMV the provably certified distinct-count summary at realistic scale, so the kernel is needed there.

Until it lands, either keep the gap (a selected KMV plan fails at bind time) or stop offering KMV in Pass 1. The executor's capability check should reject it with a clear message, not fail later.

Tests

  • KMV build/estimate against exact distinct counts.
  • Merge equals the union build.
  • A selected Example 2 plan with KMV executes end to end.

Related: #696, #694, #678.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions