amaliujia commented on code in PR #38595:
URL: https://github.com/apache/spark/pull/38595#discussion_r1020516505
##########
sql/core/src/main/scala/org/apache/spark/sql/Dataset.scala:
##########
@@ -3804,6 +3804,13 @@ class Dataset[T] private[sql](
} catch {
case _: ParseException => throw
QueryCompilationErrors.invalidViewNameError(viewName)
}
+
+ if (tableIdentifier.database.isDefined) {
+ throw new AnalysisException(
+ errorClass = "TEMP_VIEW_DOES_NOT_BELONG_TO_A_DATABASE",
Review Comment:
The config idea sounds good.
I found the parser side is using `_LEGACY_ERROR_TEMP_0054`.
```
def notAllowedToAddDBPrefixForTempViewError(
database: String,
ctx: CreateViewContext): Throwable = {
new ParseException(
errorClass = "_LEGACY_ERROR_TEMP_0054",
messageParameters = Map("database" -> database),
ctx)
}
```
We can use the same error message body but at least we should rename this
error class name.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]