Skip to content

Navigation Menu

Sign in
Sign up

fix(query-engine): make heap top-k keys collision-safe #679

Open

Description

Parent

#678

What to build

Replace or harden delimiter-based label-key encoding used by CountMinSketchWithHeap. Semicolon-joined keys cannot safely represent label values containing semicolons and can decode to the wrong label vector.

Preserve compatibility with existing persisted data if required.

Acceptance criteria

  • Distinct label vectors cannot encode to the same heap key.
  • All supported label values round-trip losslessly.
  • Existing persisted keys have a documented migration or compatibility strategy.
  • Tests cover semicolons, empty values, and multiple labels.

Blocked by

None - can start immediately.

Concrete example

Current encoding:

let encoded = labels.join(";");
let decoded = encoded.split(';').collect::<Vec<_>>();

These distinct label vectors collide:

["a;b", "c"] -> "a;b;c"
["a", "b;c"] -> "a;b;c"

A value such as path="a;b" also decodes as two labels instead of one.

The replacement should use a structured or length-prefixed representation, for example:

[3]["a;b"][1]["c"]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    AltStyle によって変換されたページ (->オリジナル) /