You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "MaxGekk (via GitHub)" <gi...@apache.org> on 2023/08/28 14:26:45 UTC

[GitHub] [spark] MaxGekk commented on a diff in pull request #42524: [SPARK-44837][SQL] Improve ALTER TABLE ALTER PARTITION column error message

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


##########
common/utils/src/main/resources/error/error-classes.json:
##########
@@ -92,6 +92,13 @@
       "The method <methodName> can not be called on streaming Dataset/DataFrame."
     ]
   },
+  "CANNOT_ALTER_PARTITION_COLUMN" : {
+    "message" : [
+      "ALTER TABLE CHANGE COLUMN is not supported for partition columns in non-delta tables.",

Review Comment:
   Does Spark support the `... CHANGE COLUMN` command? Looking at the test, it should be `ALTER TABLE ... ALTER COLUMN`



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:
##########
@@ -2577,6 +2577,15 @@ private[sql] object QueryCompilationErrors extends QueryErrorsBase with Compilat
         "newType"-> toSQLType(newColumn.dataType)))
   }
 
+  def cannotAlterPartitionColumn(
+      tableName: String,
+      columnName: String): Throwable = {
+    new AnalysisException(
+      errorClass = "CANNOT_ALTER_PARTITION_COLUMN",
+      messageParameters =
+        Map("tableName" -> tableName, "columnName" -> columnName)

Review Comment:
   Could you quote the ids 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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org