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 45e5f2e375b [SPARK-43807][SQL] Migrate _LEGACY_ERROR_TEMP_1269 to PARTITION_SCHEMA_IS_EMPTY 45e5f2e375b is described below commit 45e5f2e375bec915e1683e6d2a222488ba831c91 Author: Jiaan Geng <belie...@163.com> AuthorDate: Fri May 26 10:58:51 2023 +0300 [SPARK-43807][SQL] Migrate _LEGACY_ERROR_TEMP_1269 to PARTITION_SCHEMA_IS_EMPTY ### What changes were proposed in this pull request? Currently, DS V1 uses `_LEGACY_ERROR_TEMP_1269` and DS V2 uses `INVALID_PARTITION_OPERATION.PARTITION_SCHEMA_IS_EMPTY` if the partition operation on non-partition table. This PR want migrate `_LEGACY_ERROR_TEMP_1269` to `PARTITION_SCHEMA_IS_EMPTY` ### Why are the changes needed? Migrate `_LEGACY_ERROR_TEMP_1269` to `PARTITION_SCHEMA_IS_EMPTY`. ### Does this PR introduce _any_ user-facing change? 'Yes'. The error msg has a little change. ### How was this patch tested? Test case updated. Closes #41325 from beliefer/SPARK-43807. Authored-by: Jiaan Geng <belie...@163.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 ++-- .../apache/spark/sql/execution/command/v1/ShowPartitionsSuite.scala | 4 ++-- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/core/src/main/resources/error/error-classes.json b/core/src/main/resources/error/error-classes.json index 0246d4f378e..bbf0368ac59 100644 --- a/core/src/main/resources/error/error-classes.json +++ b/core/src/main/resources/error/error-classes.json @@ -3618,11 +3618,6 @@ "Failed to truncate table <tableIdentWithDB> when removing data of the path: <path>." ] }, - "_LEGACY_ERROR_TEMP_1269" : { - "message" : [ - "SHOW PARTITIONS is not allowed on a table that is not partitioned: <tableIdentWithDB>." - ] - }, "_LEGACY_ERROR_TEMP_1270" : { "message" : [ "SHOW CREATE TABLE is not supported on a temporary view: <table>." 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 879bf620188..9921f50014d 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 @@ -2630,8 +2630,8 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase { def showPartitionNotAllowedOnTableNotPartitionedError(tableIdentWithDB: String): Throwable = { new AnalysisException( - errorClass = "_LEGACY_ERROR_TEMP_1269", - messageParameters = Map("tableIdentWithDB" -> tableIdentWithDB)) + errorClass = "INVALID_PARTITION_OPERATION.PARTITION_SCHEMA_IS_EMPTY", + messageParameters = Map("name" -> toSQLId(tableIdentWithDB))) } def showCreateTableNotSupportedOnTempView(table: String): Throwable = { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowPartitionsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowPartitionsSuite.scala index e67ed807a87..c423bfb9f24 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowPartitionsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowPartitionsSuite.scala @@ -130,8 +130,8 @@ class ShowPartitionsSuite extends ShowPartitionsSuiteBase with CommandSuiteBase exception = intercept[AnalysisException] { sql(sqlText) }, - errorClass = "_LEGACY_ERROR_TEMP_1269", - parameters = Map("tableIdentWithDB" -> tableName)) + errorClass = "INVALID_PARTITION_OPERATION.PARTITION_SCHEMA_IS_EMPTY", + parameters = Map("name" -> tableName)) } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org