MaxGekk commented on code in PR #39910:
URL: https://github.com/apache/spark/pull/39910#discussion_r1109461614
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -2700,20 +2700,24 @@ private[sql] object QueryCompilationErrors extends
QueryErrorsBase {
name: TableIdentifier,
nameParts: String): Throwable = {
new AnalysisException(
- errorClass = "_LEGACY_ERROR_TEMP_1283",
+ errorClass = "INVALID_TEMP_OBJ_REFERENCE",
messageParameters = Map(
- "name" -> name.toString,
- "nameParts" -> nameParts))
+ "obj" -> "view",
+ "objName" -> name.toString,
Review Comment:
Could you quote the table id by using `toSQLId`:
```suggestion
"objName" -> toSQLId(name.nameParts),```
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -2700,20 +2700,24 @@ private[sql] object QueryCompilationErrors extends
QueryErrorsBase {
name: TableIdentifier,
nameParts: String): Throwable = {
new AnalysisException(
- errorClass = "_LEGACY_ERROR_TEMP_1283",
+ errorClass = "INVALID_TEMP_OBJ_REFERENCE",
messageParameters = Map(
- "name" -> name.toString,
- "nameParts" -> nameParts))
+ "obj" -> "view",
+ "objName" -> name.toString,
+ "tempObj" -> "view",
+ "tempObjName" -> nameParts))
Review Comment:
The `quote()` method uses `quoteIfNeeded`, please, use `toSQLId` to quote
the name (it always quotes ids).
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -2700,20 +2700,24 @@ private[sql] object QueryCompilationErrors extends
QueryErrorsBase {
name: TableIdentifier,
nameParts: String): Throwable = {
new AnalysisException(
- errorClass = "_LEGACY_ERROR_TEMP_1283",
+ errorClass = "INVALID_TEMP_OBJ_REFERENCE",
messageParameters = Map(
- "name" -> name.toString,
- "nameParts" -> nameParts))
+ "obj" -> "view",
+ "objName" -> name.toString,
+ "tempObj" -> "view",
+ "tempObjName" -> nameParts))
}
def notAllowedToCreatePermanentViewByReferencingTempFuncError(
name: TableIdentifier,
funcName: String): Throwable = {
new AnalysisException(
- errorClass = "_LEGACY_ERROR_TEMP_1284",
+ errorClass = "INVALID_TEMP_OBJ_REFERENCE",
messageParameters = Map(
- "name" -> name.toString,
- "funcName" -> funcName))
+ "obj" -> "view",
+ "objName" -> name.toString,
+ "tempObj" -> "function",
+ "tempObjName" -> funcName))
Review Comment:
Please, quote function id using `toSQLId()`.
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -2700,20 +2700,24 @@ private[sql] object QueryCompilationErrors extends
QueryErrorsBase {
name: TableIdentifier,
nameParts: String): Throwable = {
new AnalysisException(
- errorClass = "_LEGACY_ERROR_TEMP_1283",
+ errorClass = "INVALID_TEMP_OBJ_REFERENCE",
messageParameters = Map(
- "name" -> name.toString,
- "nameParts" -> nameParts))
+ "obj" -> "view",
+ "objName" -> name.toString,
+ "tempObj" -> "view",
+ "tempObjName" -> nameParts))
}
def notAllowedToCreatePermanentViewByReferencingTempFuncError(
name: TableIdentifier,
funcName: String): Throwable = {
new AnalysisException(
- errorClass = "_LEGACY_ERROR_TEMP_1284",
+ errorClass = "INVALID_TEMP_OBJ_REFERENCE",
messageParameters = Map(
- "name" -> name.toString,
- "funcName" -> funcName))
+ "obj" -> "view",
+ "objName" -> name.toString,
Review Comment:
```suggestion
"objName" -> toSQLId(name.nameParts),
```
--
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]