Skip to content

Vector search metric guard is ineffective and ANN segments are scored with the wrong distance metric after the metric changes #10263

Description

@LuciferYang

Search before asking

  • I searched in the issues and found no similar issues.

Paimon version

master (1.5-SNAPSHOT)

Compute Engine

Any engine using a primary-key table with a pk-vector ANN index (the distance metric is configured via fields.<col>.pk-vector.distance.metric).

Minimal reproduce step

  1. Create a primary-key table with a pk-vector column and distance.metric = inner_product.
  2. Write rows so the ANN index segments are built.
  3. Change the column's distance.metric to a different value.
  4. Run a vector search.

What doesn't meet your expectations?

The search silently scores the already-built ANN segments with the new metric, so the nearest-neighbor results are wrong. PkVectorAnnSegmentSearcher has a guard that is meant to reject searching a segment whose metric differs from the configured one, but it compares the current metric against a value derived from the same current configuration, so both sides are always equal and the guard never fires.

Anything else?

The segment stores no record of the metric it was built with, so the searcher has no way to detect the mismatch today. A fix needs to persist the build-time metric in the segment metadata and compare against that.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions