This is an automated email from the ASF dual-hosted git repository.

maxgekk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 6b88d55b14d [SPARK-41041][SQL] Integrate `_LEGACY_ERROR_TEMP_1279` 
into `TABLE_OR_VIEW_ALREADY_EXISTS`
6b88d55b14d is described below

commit 6b88d55b14df1f9d15ba921569239cde86071e7d
Author: itholic <haejoon....@databricks.com>
AuthorDate: Wed Nov 9 11:54:34 2022 +0300

    [SPARK-41041][SQL] Integrate `_LEGACY_ERROR_TEMP_1279` into 
`TABLE_OR_VIEW_ALREADY_EXISTS`
    
    ### What changes were proposed in this pull request?
    
    This PR proposes to integrate the `_LEGACY_ERROR_TEMP_1279` into 
`TABLE_OR_VIEW_ALREADY_EXISTS`.
    
    ### Why are the changes needed?
    
    They're duplicated, both explain about the view already exists.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    ```
    ./build/sbt "sql/testOnly org.apache.spark.sql.SQLQueryTestSuite*"
    ```
    
    Closes #38552 from itholic/SPARK-41041.
    
    Authored-by: itholic <haejoon....@databricks.com>
    Signed-off-by: Max Gekk <max.g...@gmail.com>
---
 core/src/main/resources/error/error-classes.json                     | 5 -----
 .../scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala   | 4 ++--
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/core/src/main/resources/error/error-classes.json 
b/core/src/main/resources/error/error-classes.json
index 57fe79ef184..71703e7efd9 100644
--- a/core/src/main/resources/error/error-classes.json
+++ b/core/src/main/resources/error/error-classes.json
@@ -2972,11 +2972,6 @@
       "<name> is not a view."
     ]
   },
-  "_LEGACY_ERROR_TEMP_1279" : {
-    "message" : [
-      "View <name> already exists. If you want to update the view definition, 
please use ALTER VIEW AS or CREATE OR REPLACE VIEW AS."
-    ]
-  },
   "_LEGACY_ERROR_TEMP_1280" : {
     "message" : [
       "It is not allowed to create a persisted view from the Dataset API."
diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
index 139ea236e49..67ceafbf03d 100644
--- 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
+++ 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
@@ -2667,8 +2667,8 @@ private[sql] object QueryCompilationErrors extends 
QueryErrorsBase {
 
   def viewAlreadyExistsError(name: TableIdentifier): Throwable = {
     new AnalysisException(
-      errorClass = "_LEGACY_ERROR_TEMP_1279",
-      messageParameters = Map("name" -> name.toString))
+      errorClass = "TABLE_OR_VIEW_ALREADY_EXISTS",
+      messageParameters = Map("relationName" -> name.toString))
   }
 
   def createPersistedViewFromDatasetAPINotAllowedError(): Throwable = {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to