MaxGekk commented on code in PR #39723:
URL: https://github.com/apache/spark/pull/39723#discussion_r1089652125
##########
sql/core/src/test/scala/org/apache/spark/sql/errors/QueryCompilationErrorsSuite.scala:
##########
@@ -679,6 +680,44 @@ class QueryCompilationErrorsSuite
context = ExpectedContext("", "", 7, 13, "CAST(1)")
)
}
+
+ test("IDENTIFIER_TOO_MANY_NAME_PARTS: " +
+ "create temp view doesn't support identifiers consisting of more than 2
parts") {
+ checkError(
+ exception = intercept[ParseException] {
+ sql("CREATE TEMPORARY VIEW db_name.schema_name.view_name AS SELECT '1'
as test_column")
+ },
+ errorClass = "IDENTIFIER_TOO_MANY_NAME_PARTS",
+ parameters = Map(
+ "quoted" -> "db_name.schema_name.view_name",
Review Comment:
db_name.schema_name.view_name should be quoted by backticks.
##########
core/src/main/resources/error/error-classes.json:
##########
@@ -581,6 +581,12 @@
],
"sqlState" : "42805"
},
+ "IDENTIFIER_TOO_MANY_NAME_PARTS" : {
+ "message" : [
+ "<quoted> is not a valid <identifier> as it has more than 2 name parts."
Review Comment:
Let's don't pass TableIdentifier or FunctionIdentifier, and just say:
```suggestion
"<quoted> is not a valid identifier as it has more than 2 name parts."
```
sine the camel-case ids might confuse users and are not so much useful.
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -1867,7 +1867,7 @@ private[sql] object QueryCompilationErrors extends
QueryErrorsBase {
def identifierHavingMoreThanTwoNamePartsError(
quoted: String, identifier: String): Throwable = {
new AnalysisException(
- errorClass = "_LEGACY_ERROR_TEMP_1185",
+ errorClass = "IDENTIFIER_TOO_MANY_NAME_PARTS",
messageParameters = Map(
"quoted" -> quoted,
Review Comment:
Please, pass the original parts and use `toSQLId()` to always quote them by
backticks.
--
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]