Improve unsupported compound identifier message#13605
Merged
alamb merged 1 commit intoapache:mainfrom Nov 30, 2024
Merged
Conversation
alamb
commented
Nov 29, 2024
| SELECT COUNT(*) FROM nonexistentcatalog.public.aggregate_test_100 | ||
|
|
||
| statement error Error during planning: Unsupported compound identifier '\[Ident \{ value: "way", quote_style: None \}, Ident \{ value: "too", quote_style: None \}, Ident \{ value: "many", quote_style: None \}, Ident \{ value: "namespaces", quote_style: None \}, Ident \{ value: "as", quote_style: None \}, Ident \{ value: "ident", quote_style: None \}, Ident \{ value: "prefixes", quote_style: None \}, Ident \{ value: "aggregate_test_100", quote_style: None \}\]' | ||
| statement error DataFusion error: Error during planning: Unsupported compound identifier 'way\.too\.many\.namespaces\.as\.ident\.prefixes\.aggregate_test_100'\. Expected 1, 2 or 3 parts, got 8 |
Contributor
Author
There was a problem hiding this comment.
This line has to change anyways with the sqlparser update, and I think this PR has a nicer message
jonahgao
approved these changes
Nov 29, 2024
| impl IdentTaker { | ||
| fn take(&mut self, enable_normalization: bool) -> String { | ||
| let ident = self.0.pop().expect("no more identifiers"); | ||
| IdentNormalizer::new(enable_normalization).normalize(ident) |
Member
There was a problem hiding this comment.
Not related to the current PR, maybe we can move IdentNormalizer into IdentTaker to simplify take() and avoid creating normalizer every time.
Contributor
Author
There was a problem hiding this comment.
will do in a follow on PR
Update: in #13609
| SELECT COUNT(*) FROM nonexistentcatalog.public.aggregate_test_100 | ||
|
|
||
| statement error Error during planning: Unsupported compound identifier '\[Ident \{ value: "way", quote_style: None \}, Ident \{ value: "too", quote_style: None \}, Ident \{ value: "many", quote_style: None \}, Ident \{ value: "namespaces", quote_style: None \}, Ident \{ value: "as", quote_style: None \}, Ident \{ value: "ident", quote_style: None \}, Ident \{ value: "prefixes", quote_style: None \}, Ident \{ value: "aggregate_test_100", quote_style: None \}\]' | ||
| statement error DataFusion error: Error during planning: Unsupported compound identifier 'way\.too\.many\.namespaces\.as\.ident\.prefixes\.aggregate_test_100'\. Expected 1, 2 or 3 parts, got 8 |
Weijun-H
approved these changes
Nov 30, 2024
Contributor
Author
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.
Which issue does this PR close?
Rationale for this change
While working on the upgrade of sqlparser, the structure has changed and thus the debug formatting has changed (so I needed to change this error message anyways)
The error message was hard to understand anyways, so I spent a few moments improving it to show the actual indentifers rather than a debug version
What changes are included in this PR?
Are these changes tested?
Yes
Are there any user-facing changes?