Skip to content

fix(index): match fresh-encode output schema in RQTransformer early return - #9396

Open
LuciferYang wants to merge 3 commits into
lance-format:mainfrom
LuciferYang:fix/ivf-rq-rq-early-return-schema
Open

LuciferYang wants to merge 3 commits into
lance-format:mainfrom
LuciferYang:fix/ivf-rq-rq-early-return-schema

Conversation

@LuciferYang

Copy link
Copy Markdown
Contributor

Closes #9395

The fresh-encode path drops the vector and centroid-distance columns before returning; the early return for an already-encoded batch returned it untouched, so the transformer's output schema depended on whether the codes were already present. It now drops the same two columns on that path, and drop_column is a no-op when they are absent, so a pre-encoded batch that has already lost them is unaffected.

No in-tree caller changes behaviour: the pre-encoded batches Lance produces have already dropped the vector column by the time they reach here.

How was this patch tested?

test_rq_transformer_early_return_matches_fresh_encode_schema encodes a batch, re-attaches the vector and centroid-distance columns to the encoded result, feeds that back through the transformer, and compares the two output schemas field by field. Restoring Ok(batch.clone()) fails it.

…eturn

The already-encoded early return kept the vector and centroid-dist
columns that the normal path drops, so re-processed batches carried a
different schema than freshly-encoded ones. Drop both columns when
present in the early return.

Assisted-by: GLM-5.3
@github-actions github-actions Bot added A-index Vector index, linalg, tokenizer bug Something isn't working labels Sep 18, 2026

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gate recommendation: approve.

The already-encoded exit now applies the same schema normalization as fresh encoding, so callers receive a stable transformer contract without needing caller-specific projections. The change reuses the existing no-op-safe column removal and is covered by a regression that exercises the pre-encoded path.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-index Vector index, linalg, tokenizer bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: RQTransformer emits two different schemas depending on whether the batch was already encoded

1 participant