cloud-fan commented on code in PR #42524:
URL: https://github.com/apache/spark/pull/42524#discussion_r1300792622
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/command/ddl.scala:
##########
@@ -415,9 +415,22 @@ case class AlterTableChangeColumnCommand(
Seq.empty[Row]
}
+ private def verifyNonPartitionColumn(
+ table: CatalogTable, name: String, resolver: Resolver): Unit = {
+ table.partitionSchema.fields.collectFirst {
+ case field if resolver(field.name, name) => field
+ } match {
+ case Some(_) =>
+ throw
QueryCompilationErrors.alterTableChangeColumnNotSupportedForPartitionColumn(
+ table.qualifiedName,
+ columnName)
+ case None =>
+ }
+ }
+
// Find the origin column from schema by column name, throw an
AnalysisException if the column
// reference is invalid.
- private def findColumnByName(
Review Comment:
shall we add `def findColumnByName(...): Option[StructField]`, so that we
can use it to find both partition and data columns?
--
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]