fix(dataset): fail-fast casting for columns with attached indices#7158
Open
WenDing-Y wants to merge 3 commits into
Open
fix(dataset): fail-fast casting for columns with attached indices#7158WenDing-Y wants to merge 3 commits into
WenDing-Y wants to merge 3 commits into
Conversation
Implement fail-fast behavior for casting columns with attached indices to prevent silent index drops. Update tests to ensure proper error messages and dataset integrity when attempting to cast indexed columns.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Currently, calling
alter_columnswith a cast on a column that has an attachedindex silently drops the index without any warning or error. This has caused
production incidents where vector search silently regressed to brute-force scan.
This PR adds a fail-fast check before any cast is performed: if a target
column has any index attached, the operation is rejected with a clear error
message that names the affected column(s), the index(es), and the required
remediation (
drop_index()→ cast → rebuild index).Changes
alter_columnsthat scans cast target columnsfor attached indices
Error::invalid_inputwith column names, index names,and remediation steps when a conflict is detected
to explicitly
drop_index()before castingtest_alter_columns_cast_fails_with_attached_indexcoveringthe IVF_PQ index path: verifies the error message, schema integrity, index
preservation, and that the cast succeeds after a manual drop
Breaking Change⚠️
Callers that previously depended on the silent index-drop behavior must now
explicitly call
drop_index()beforealter_columnswith a cast, then rebuildthe index afterward.