-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[SPARK-33515][SQL] Improve exception messages while handling UnresolvedTable #30461
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
Conversation
Kubernetes integration test starting |
Kubernetes integration test status success |
Test build #131518 has finished for PR 30461 at commit
|
Kubernetes integration test starting |
Kubernetes integration test status success |
@cloud-fan Please check if the new exception messages make sense. Thanks! |
Test build #131528 has finished for PR 30461 at commit
|
GA passed, merging to master, thanks! |
lookupTableOrView(identifier).map { | ||
case v: ResolvedView => | ||
val viewStr = if (v.isTemp) "temp view" else "view" | ||
u.failAnalysis(s"${v.identifier.quoted} is a $viewStr not table.") | ||
u.failAnalysis(s"${v.identifier.quoted} is a $viewStr. '$cmd' expects a table.'") |
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.
'
at the end is not needed. I will remove it in this PR: #30398
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.
Thanks @MaxGekk!
What changes were proposed in this pull request?
This PR proposes to improve the exception messages while
UnresolvedTable
is handled based on this suggestion: #30321 (comment).Currently, when an identifier is resolved to a view when a table is expected, the following exception message is displayed (e.g., for
COMMENT ON TABLE
):After this PR, the message will be:
Also, if an identifier is not resolved, the following exception message is currently used:
After this PR, the message will be:
Why are the changes needed?
To improve the exception message.
Does this PR introduce any user-facing change?
Yes, the exception message will be changed as described above.
How was this patch tested?
Updated existing tests.