[SPARK-33515][SQL] Improve exception messages while handling UnresolvedTable#30461
[SPARK-33515][SQL] Improve exception messages while handling UnresolvedTable#30461imback82 wants to merge 3 commits intoapache:masterfrom
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! |
| 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.
' at the end is not needed. I will remove it in this PR: #30398
What changes were proposed in this pull request?
This PR proposes to improve the exception messages while
UnresolvedTableis 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.