-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-42337][SQL] Add error class INVALID_TEMP_OBJ_REFERENCE #39910
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
[SPARK-42337][SQL] Add error class INVALID_TEMP_OBJ_REFERENCE #39910
Conversation
| }, | ||
| "CREATE_PERSISTENT_OBJECT_OVER_TEMP_OBJECT" : { | ||
| "message" : [ | ||
| "Cannot create a persistent <obj> <objName> by referencing a temporary <tempObj> <tempObjName>. Please make the temporary <tempObj> persistent, or make the persistent <obj> temporary." |
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.
Is there any difference among persistent and permanent? The original errors talk about permanent but your named the object differently. Just wonder why?
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.
I think they are used interchangeably in Spark. Any preference here @srielau?
MaxGekk
left a comment
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.
@allisonwang-db Please, update PR's title and description w/ new error class name.
| "name" -> name.toString, | ||
| "nameParts" -> nameParts)) | ||
| "obj" -> "view", | ||
| "objName" -> name.toString, |
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.
Could you quote the table id by using toSQLId:
| "objName" -> name.toString, | |
| "objName" -> toSQLId(name.nameParts), |
| "obj" -> "view", | ||
| "objName" -> name.toString, | ||
| "tempObj" -> "view", | ||
| "tempObjName" -> nameParts)) |
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.
The quote() method uses quoteIfNeeded, please, use toSQLId to quote the name (it always quotes ids).
| "name" -> name.toString, | ||
| "funcName" -> funcName)) | ||
| "obj" -> "view", | ||
| "objName" -> name.toString, |
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.
| "objName" -> name.toString, | |
| "objName" -> toSQLId(name.nameParts), |
| "obj" -> "view", | ||
| "objName" -> name.toString, | ||
| "tempObj" -> "function", | ||
| "tempObjName" -> funcName)) |
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.
Please, quote function id using toSQLId().
|
The kub test is not related to this PR, I think: |
|
+1, LGTM. Merging to master. |
…P_OBJ_REFERENCE ### What changes were proposed in this pull request? This PR is a follow-up for #39910. It updates the error message of the error class INVALID_TEMP_OBJ_REFERENCE. ### Why are the changes needed? To make the error message more user-friendly. ### Does this PR introduce _any_ user-facing change? Yes. This PR updates the error message for INVALID_TEMP_OBJ_REFERENCE. ### How was this patch tested? Existing tests Closes #40198 from allisonwang-db/spark-42337-follow-up. Authored-by: allisonwang-db <allison.wang@databricks.com> Signed-off-by: Max Gekk <max.gekk@gmail.com>
What changes were proposed in this pull request?
This PR adds a new error class
INVALID_TEMP_OBJ_REFERENCEand replaces two existing error classes with this new one:Why are the changes needed?
To improve the error messages.
Does this PR introduce any user-facing change?
Yes, the PR changes a user-facing error message.
How was this patch tested?
Existing unit tests.