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


##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -5010,6 +5010,43 @@
     },
     "sqlState" : "0A000"
   },
+  "UNSUPPORTED_SHOW_CREATE_TABLE" : {
+    "message" : [
+      "Unsupported show create table command."
+    ],
+    "subClass" : {
+      "ON_DATA_SOURCE_TABLE_WITH_AS_SERDE" : {
+        "message" : [
+          "<table> is a Spark data source table. Please use `SHOW CREATE 
TABLE` without `AS SERDE` instead."

Review Comment:
   Please, follow to `toSQLStmt()`, and just upper case the SQL statements:
   ```suggestion
             "The table <tableName> is a Spark data source table. Please use 
SHOW CREATE TABLE without AS SERDE instead."
   ```



##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -5010,6 +5010,43 @@
     },
     "sqlState" : "0A000"
   },
+  "UNSUPPORTED_SHOW_CREATE_TABLE" : {
+    "message" : [
+      "Unsupported show create table command."
+    ],
+    "subClass" : {
+      "ON_DATA_SOURCE_TABLE_WITH_AS_SERDE" : {
+        "message" : [
+          "<table> is a Spark data source table. Please use `SHOW CREATE 
TABLE` without `AS SERDE` instead."
+        ]
+      },
+      "ON_TEMPORARY_VIEW" : {
+        "message" : [
+          "`SHOW CREATE TABLE` is not supported on a temporary view <table>."
+        ]
+      },
+      "ON_TRANSACTIONAL_HIVE_TABLE" : {
+        "message" : [
+          "Failed to execute `SHOW CREATE TABLE` against transactional Hive 
table <table>.",
+          "Please use `SHOW CREATE TABLE <table> AS SERDE` to show Hive DDL 
instead."
+        ]
+      },
+      "WITH_UNSUPPORTED_FEATURE" : {
+        "message" : [
+          "Failed to execute `SHOW CREATE TABLE` against table/view <table>, 
which is created by Hive and uses the following unsupported features",
+          "<unsupportedFeatures>"
+        ]
+      },
+      "WITH_UNSUPPORTED_SERDE_CONFIGURATION" : {
+        "message" : [
+          "Failed to execute `SHOW CREATE TABLE` against table <table>, which 
is created by Hive and uses the following unsupported serde configuration",

Review Comment:
   ```suggestion
             "Failed to execute the command against the table <tableName> which 
is created by Hive and uses the following unsupported serde configuration",
   ```



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -2975,29 +2975,21 @@ private[sql] object QueryCompilationErrors extends 
QueryErrorsBase with Compilat
 
   def showCreateTableNotSupportedOnTempView(table: String): Throwable = {
     new AnalysisException(
-      errorClass = "_LEGACY_ERROR_TEMP_1270",
+      errorClass = "UNSUPPORTED_SHOW_CREATE_TABLE.ON_TEMPORARY_VIEW",
       messageParameters = Map("table" -> table))
   }
 
-  def showCreateTableFailToExecuteUnsupportedFeatureError(table: 
CatalogTable): Throwable = {
-    new AnalysisException(
-      errorClass = "_LEGACY_ERROR_TEMP_1271",
-      messageParameters = Map(
-        "unsupportedFeatures" -> table.unsupportedFeatures.map(" - " + 
_).mkString("\n"),
-        "table" -> table.identifier.toString))
-  }
-
   def showCreateTableNotSupportTransactionalHiveTableError(table: 
CatalogTable): Throwable = {
     new AnalysisException(
-      errorClass = "_LEGACY_ERROR_TEMP_1272",
+      errorClass = "UNSUPPORTED_SHOW_CREATE_TABLE.ON_TRANSACTIONAL_HIVE_TABLE",
       messageParameters = Map("table" -> table.identifier.toString))

Review Comment:
   quote the table id by `toSQLId()`, please.



##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -5010,6 +5010,43 @@
     },
     "sqlState" : "0A000"
   },
+  "UNSUPPORTED_SHOW_CREATE_TABLE" : {
+    "message" : [
+      "Unsupported show create table command."
+    ],
+    "subClass" : {
+      "ON_DATA_SOURCE_TABLE_WITH_AS_SERDE" : {
+        "message" : [
+          "<table> is a Spark data source table. Please use `SHOW CREATE 
TABLE` without `AS SERDE` instead."
+        ]
+      },
+      "ON_TEMPORARY_VIEW" : {
+        "message" : [
+          "`SHOW CREATE TABLE` is not supported on a temporary view <table>."

Review Comment:
   You already mentioned `SHOW CREATE TABLE` in parent's message. Just refer to 
it like:
   ```suggestion
             "The command is not supported on a temporary view <table>."
   ```



##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -5010,6 +5010,43 @@
     },
     "sqlState" : "0A000"
   },
+  "UNSUPPORTED_SHOW_CREATE_TABLE" : {
+    "message" : [
+      "Unsupported show create table command."

Review Comment:
   ```suggestion
         "Unsupported a SHOW CREATE TABLE command."
   ```



##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -5010,6 +5010,43 @@
     },
     "sqlState" : "0A000"
   },
+  "UNSUPPORTED_SHOW_CREATE_TABLE" : {
+    "message" : [
+      "Unsupported show create table command."
+    ],
+    "subClass" : {
+      "ON_DATA_SOURCE_TABLE_WITH_AS_SERDE" : {
+        "message" : [
+          "<table> is a Spark data source table. Please use `SHOW CREATE 
TABLE` without `AS SERDE` instead."
+        ]
+      },
+      "ON_TEMPORARY_VIEW" : {
+        "message" : [
+          "`SHOW CREATE TABLE` is not supported on a temporary view <table>."
+        ]
+      },
+      "ON_TRANSACTIONAL_HIVE_TABLE" : {
+        "message" : [
+          "Failed to execute `SHOW CREATE TABLE` against transactional Hive 
table <table>.",
+          "Please use `SHOW CREATE TABLE <table> AS SERDE` to show Hive DDL 
instead."
+        ]
+      },
+      "WITH_UNSUPPORTED_FEATURE" : {
+        "message" : [
+          "Failed to execute `SHOW CREATE TABLE` against table/view <table>, 
which is created by Hive and uses the following unsupported features",
+          "<unsupportedFeatures>"
+        ]
+      },
+      "WITH_UNSUPPORTED_SERDE_CONFIGURATION" : {
+        "message" : [
+          "Failed to execute `SHOW CREATE TABLE` against table <table>, which 
is created by Hive and uses the following unsupported serde configuration",
+          "<configs>",
+          "Please use `SHOW CREATE TABLE <table> AS SERDE` to show Hive DDL 
instead."

Review Comment:
   ```suggestion
             "Please use SHOW CREATE TABLE <tableName> AS SERDE to show Hive 
DDL instead."
   ```



##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -5010,6 +5010,43 @@
     },
     "sqlState" : "0A000"
   },
+  "UNSUPPORTED_SHOW_CREATE_TABLE" : {
+    "message" : [
+      "Unsupported show create table command."
+    ],
+    "subClass" : {
+      "ON_DATA_SOURCE_TABLE_WITH_AS_SERDE" : {
+        "message" : [
+          "<table> is a Spark data source table. Please use `SHOW CREATE 
TABLE` without `AS SERDE` instead."
+        ]
+      },
+      "ON_TEMPORARY_VIEW" : {
+        "message" : [
+          "`SHOW CREATE TABLE` is not supported on a temporary view <table>."
+        ]
+      },
+      "ON_TRANSACTIONAL_HIVE_TABLE" : {
+        "message" : [
+          "Failed to execute `SHOW CREATE TABLE` against transactional Hive 
table <table>.",

Review Comment:
   ```suggestion
             "Failed to execute the command against transactional Hive table 
<tableName>.",
   ```



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -2975,29 +2975,21 @@ private[sql] object QueryCompilationErrors extends 
QueryErrorsBase with Compilat
 
   def showCreateTableNotSupportedOnTempView(table: String): Throwable = {
     new AnalysisException(
-      errorClass = "_LEGACY_ERROR_TEMP_1270",
+      errorClass = "UNSUPPORTED_SHOW_CREATE_TABLE.ON_TEMPORARY_VIEW",
       messageParameters = Map("table" -> table))
   }
 
-  def showCreateTableFailToExecuteUnsupportedFeatureError(table: 
CatalogTable): Throwable = {
-    new AnalysisException(
-      errorClass = "_LEGACY_ERROR_TEMP_1271",
-      messageParameters = Map(
-        "unsupportedFeatures" -> table.unsupportedFeatures.map(" - " + 
_).mkString("\n"),
-        "table" -> table.identifier.toString))
-  }
-
   def showCreateTableNotSupportTransactionalHiveTableError(table: 
CatalogTable): Throwable = {
     new AnalysisException(
-      errorClass = "_LEGACY_ERROR_TEMP_1272",
+      errorClass = "UNSUPPORTED_SHOW_CREATE_TABLE.ON_TRANSACTIONAL_HIVE_TABLE",
       messageParameters = Map("table" -> table.identifier.toString))
   }
 
   def showCreateTableFailToExecuteUnsupportedConfError(
       table: TableIdentifier,
       builder: mutable.StringBuilder): Throwable = {
     new AnalysisException(
-      errorClass = "_LEGACY_ERROR_TEMP_1273",
+      errorClass = 
"UNSUPPORTED_SHOW_CREATE_TABLE.WITH_UNSUPPORTED_SERDE_CONFIGURATION",
       messageParameters = Map(
         "table" -> table.identifier,

Review Comment:
   Please, use `toSQLId()`



##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -5010,6 +5010,43 @@
     },
     "sqlState" : "0A000"
   },
+  "UNSUPPORTED_SHOW_CREATE_TABLE" : {
+    "message" : [
+      "Unsupported show create table command."
+    ],
+    "subClass" : {
+      "ON_DATA_SOURCE_TABLE_WITH_AS_SERDE" : {
+        "message" : [
+          "<table> is a Spark data source table. Please use `SHOW CREATE 
TABLE` without `AS SERDE` instead."
+        ]
+      },
+      "ON_TEMPORARY_VIEW" : {
+        "message" : [
+          "`SHOW CREATE TABLE` is not supported on a temporary view <table>."
+        ]
+      },
+      "ON_TRANSACTIONAL_HIVE_TABLE" : {
+        "message" : [
+          "Failed to execute `SHOW CREATE TABLE` against transactional Hive 
table <table>.",
+          "Please use `SHOW CREATE TABLE <table> AS SERDE` to show Hive DDL 
instead."

Review Comment:
   ```suggestion
             "Please use SHOW CREATE TABLE <tableName> AS SERDE to show Hive 
DDL instead."
   ```



##########
common/utils/src/main/resources/error/error-conditions.json:
##########
@@ -5010,6 +5010,43 @@
     },
     "sqlState" : "0A000"
   },
+  "UNSUPPORTED_SHOW_CREATE_TABLE" : {
+    "message" : [
+      "Unsupported show create table command."
+    ],
+    "subClass" : {
+      "ON_DATA_SOURCE_TABLE_WITH_AS_SERDE" : {
+        "message" : [
+          "<table> is a Spark data source table. Please use `SHOW CREATE 
TABLE` without `AS SERDE` instead."
+        ]
+      },
+      "ON_TEMPORARY_VIEW" : {
+        "message" : [
+          "`SHOW CREATE TABLE` is not supported on a temporary view <table>."
+        ]
+      },
+      "ON_TRANSACTIONAL_HIVE_TABLE" : {
+        "message" : [
+          "Failed to execute `SHOW CREATE TABLE` against transactional Hive 
table <table>.",
+          "Please use `SHOW CREATE TABLE <table> AS SERDE` to show Hive DDL 
instead."
+        ]
+      },
+      "WITH_UNSUPPORTED_FEATURE" : {
+        "message" : [
+          "Failed to execute `SHOW CREATE TABLE` against table/view <table>, 
which is created by Hive and uses the following unsupported features",

Review Comment:
   ```suggestion
             "Failed to execute the command against table/view <tableName> 
which is created by Hive and uses the following unsupported features",
   ```



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -3006,18 +2998,18 @@ private[sql] object QueryCompilationErrors extends 
QueryErrorsBase with Compilat
   def showCreateTableAsSerdeNotAllowedOnSparkDataSourceTableError(
       table: TableIdentifier): Throwable = {
     new AnalysisException(
-      errorClass = "_LEGACY_ERROR_TEMP_1274",
+      errorClass = 
"UNSUPPORTED_SHOW_CREATE_TABLE.ON_DATA_SOURCE_TABLE_WITH_AS_SERDE",
       messageParameters = Map("table" -> table.toString))

Review Comment:
   Wrap by `toSQLId()`



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -3006,18 +2998,18 @@ private[sql] object QueryCompilationErrors extends 
QueryErrorsBase with Compilat
   def showCreateTableAsSerdeNotAllowedOnSparkDataSourceTableError(
       table: TableIdentifier): Throwable = {
     new AnalysisException(
-      errorClass = "_LEGACY_ERROR_TEMP_1274",
+      errorClass = 
"UNSUPPORTED_SHOW_CREATE_TABLE.ON_DATA_SOURCE_TABLE_WITH_AS_SERDE",
       messageParameters = Map("table" -> table.toString))
   }
 
   def showCreateTableOrViewFailToExecuteUnsupportedFeatureError(
       table: CatalogTable,
-      features: Seq[String]): Throwable = {
+      unsupportedFeatures: Seq[String]): Throwable = {
     new AnalysisException(
-      errorClass = "_LEGACY_ERROR_TEMP_1275",
+      errorClass = "UNSUPPORTED_SHOW_CREATE_TABLE.WITH_UNSUPPORTED_FEATURE",
       messageParameters = Map(
         "table" -> table.identifier.toString,

Review Comment:
   quote 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