MaxGekk commented on code in PR #41504:
URL: https://github.com/apache/spark/pull/41504#discussion_r1233856891


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewTestSuite.scala:
##########
@@ -728,8 +728,8 @@ class PersistedViewTestSuite extends SQLViewTestSuite with 
SharedSparkSession {
         exception = intercept[AnalysisException] {
           sql("SELECT * FROM v")
         },
-        errorClass = "_LEGACY_ERROR_TEMP_1333",
-        parameters = Map("viewText" -> "DROP VIEW v", "tableName" -> 
"spark_catalog.default.v")
+        errorClass = "INVALID_VIEW_TEXT",
+        parameters = Map("viewText" -> "DROP VIEW v", "viewName" -> 
"spark_catalog.default.v")

Review Comment:
   `viewName` is an id, should be quoted by `toSQLId`



##########
core/src/main/resources/error/error-classes.json:
##########
@@ -2107,6 +2137,11 @@
     ],
     "sqlState" : "42704"
   },
+  "UNRESOLVABLE_TABLE_VALUED_FUNCTION" : {
+    "message" : [
+      "could not resolve <name> to a table-valued function. Please make sure 
that `<name>` is defined as a table-valued function and that all required 
parameters are provided correctly. If `<name>` is not defined, please create 
the table-valued function before using it. For more information about defining 
table-valued functions, please refer to the Apache Spark documentation."

Review Comment:
   ```suggestion
         "Could not resolve <name> to a table-valued function. Please make sure 
that `<name>` is defined as a table-valued function and that all required 
parameters are provided correctly. If `<name>` is not defined, please create 
the table-valued function before using it. For more information about defining 
table-valued functions, please refer to the Apache Spark documentation."
   ```



##########
core/src/main/resources/error/error-classes.json:
##########
@@ -689,6 +699,11 @@
     ],
     "sqlState" : "42K04"
   },
+  "FAILED_SQL_EXPRESSION_EVALUATION" : {
+    "message" : [
+      "Failed to evaluate the SQL expression: <sqlExpr>.Please check your 
syntax and ensure all required tables and columns are available."

Review Comment:
   ```suggestion
         "Failed to evaluate the SQL expression: <sqlExpr>. Please check your 
syntax and ensure all required tables and columns are available."
   ```



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -3119,12 +3119,12 @@ private[sql] object QueryCompilationErrors extends 
QueryErrorsBase {
       messageParameters = Map("errorMessage" -> errorMessage))
   }
 
-  def invalidViewText(viewText: String, tableName: String): Throwable = {
+  def invalidViewText(viewText: String, viewName: String): Throwable = {
     new AnalysisException(
-      errorClass = "_LEGACY_ERROR_TEMP_1333",
+      errorClass = "INVALID_VIEW_TEXT",
       messageParameters = Map(
         "viewText" -> viewText,
-        "tableName" -> tableName))
+        "viewName" -> viewName))

Review Comment:
   Please, quote `viewName` by `toSQLId()`.



-- 
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]

Reply via email to