-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat: add hint for missing fields #14521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4f93b85
feat: add hint for missing fields
Lordworms 7d8a83e
set threshold to include 0.5
Lordworms 84f11ee
fix failed test
Lordworms b4b12fe
add diagnose
Lordworms 10226c3
fix clippy
Lordworms da5cbdf
fix bugs
Lordworms 9e10bc9
add test
Lordworms 46d7f53
fix test
Lordworms a6a7d70
fix clippy
Lordworms 09b1923
Merge remote-tracking branch 'apache/main' into issue_14466
alamb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,4 +169,19 @@ statement ok | |
INSERT INTO tab0 VALUES(83,0,38); | ||
|
||
query error DataFusion error: Arrow error: Divide by zero error | ||
SELECT DISTINCT - 84 FROM tab0 AS cor0 WHERE NOT + 96 / + col1 <= NULL GROUP BY col1, col0; | ||
SELECT DISTINCT - 84 FROM tab0 AS cor0 WHERE NOT + 96 / + col1 <= NULL GROUP BY col1, col0; | ||
|
||
statement ok | ||
create table a(timestamp int, birthday int, ts int, tokens int, amp int, staamp int); | ||
|
||
query error DataFusion error: Schema error: No field named timetamp\. Did you mean 'a\.timestamp'\?\. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice! |
||
select timetamp from a; | ||
|
||
query error DataFusion error: Schema error: No field named dadsada\. Valid fields are a\.timestamp, a\.birthday, a\.ts, a\.tokens, a\.amp, a\.staamp\. | ||
select dadsada from a; | ||
|
||
query error DataFusion error: Schema error: No field named ammp\. Did you mean 'a\.amp'\?\. | ||
select ammp from a; | ||
|
||
statement ok | ||
drop table a; |
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would happened if a very similar column (e.g.
first_neme
) was in scope. I guess they would see"possible column a.first_neme"
even though there wasn't really ambiguity there because the planner didn't match that column.I don't think this is desirable. What do you think @comphead @alamb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My feeling ambiguity might be okay, the final choice is on the user but what is definitely needs to avoid ig leventshein gets false positives and get 0.5 match. in this case the closest column name will be proposed(which can be totally different from what user typed) but others also hidden. If that happen user will have to do more action like
EXPLAIN
to find the schema. Not sure how to test such scenario thoughThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok if you say non-exact matches should be shown too, I'm on board.