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


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala:
##########
@@ -377,8 +377,13 @@ case class AlterTableChangeColumnCommand(
     val resolver = sparkSession.sessionState.conf.resolver
     DDLUtils.verifyAlterTableType(catalog, table, isView = false)
 
-    // Find the origin column from dataSchema by column name.
+    // check that the column is not a partition column

Review Comment:
   `check` -> `Check`



##########
sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala:
##########
@@ -377,8 +377,13 @@ case class AlterTableChangeColumnCommand(
     val resolver = sparkSession.sessionState.conf.resolver
     DDLUtils.verifyAlterTableType(catalog, table, isView = false)
 
-    // Find the origin column from dataSchema by column name.
+    // check that the column is not a partition column
+    if (findColumnByName(table.partitionSchema, columnName, 
resolver).isDefined) {

Review Comment:
   How about `table.partitionSchema.fieldNames.exists(resolver(_, columnName))` 
?
   
   So we no need change `findColumnByName` and related code.



-- 
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-unsubscr...@spark.apache.org

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


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

Reply via email to