feat(core): add fuzzy matching suggestions for missing columns (#5642)#5979
Open
SIDDHESH-8213 wants to merge 2 commits intolance-format:mainfrom
Open
feat(core): add fuzzy matching suggestions for missing columns (#5642)#5979SIDDHESH-8213 wants to merge 2 commits intolance-format:mainfrom
SIDDHESH-8213 wants to merge 2 commits intolance-format:mainfrom
Conversation
Contributor
|
Hey thanks for creating a PR. I think this is being concurrently worked on in #5976. You can see I have similar feedback there. Perhaps you can help review that one and work on a follow up PR once that one is complete? |
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.
Description
This PR addresses issue #5642 by implementing fuzzy matching suggestions for
ColumnNotFounderrors. When a user attempts to access a field that does not exist in the schema, the engine now calculates the Levenshtein distance against available fields and suggests the closest match if it falls within a threshold (edit distance ≤ 2).Changes
strsimtolance-coreto handle string similarity metrics.do_projectinschema.rsto provide "Did you mean...?" suggestions during projections.FieldRef::into_idto include similar suggestions for path-based lookups.suggest_closest_columnas a private helper function to keep the fuzzy matching logic reusable and encapsulated.Testing performed
test_schema_typo_suggestionto verify both top-level projections and nested path resolutions."vctor"->"vector""timstamp"->"timestamp"lance-coretest suite to ensure no regressions in schema validation or resolution logic.Related Issues
Closes #5642