Search before asking
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
- Create a primary-key table with a pk-vector column and
distance.metric = inner_product.
- Write rows so the ANN index segments are built.
- Change the column's
distance.metric to a different value.
- 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?
Search before asking
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
distance.metric = inner_product.distance.metricto a different value.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.
PkVectorAnnSegmentSearcherhas 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?