cloud-fan commented on a change in pull request #33200:
URL: https://github.com/apache/spark/pull/33200#discussion_r674760040



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/v2Commands.scala
##########
@@ -1099,21 +1066,83 @@ case class UnsetTableProperties(
     copy(table = newChild)
 }
 
-trait AlterTableCommand extends UnaryCommand {
+trait AlterTableColumnCommand extends UnaryCommand {
   def table: LogicalPlan
-  def operation: String
   def changes: Seq[TableChange]
   override def child: LogicalPlan = table
 }
 
+/**
+ * The logical plan of the ALTER TABLE ... ADD COLUMNS command.
+ */
+case class AlterTableAddColumns(
+    table: LogicalPlan,
+    columnsToAdd: Seq[QualifiedColType]) extends AlterTableColumnCommand {
+  import org.apache.spark.sql.connector.catalog.CatalogV2Util._
+  columnsToAdd.foreach { c =>
+    failNullType(c.dataType)
+    TypeUtils.failWithIntervalType(c.dataType)
+  }
+
+  override def changes: Seq[TableChange] = {
+    columnsToAdd.map { col =>
+      require(col.position.forall(_.resolved),

Review comment:
       do we need the `path` to be resolved as well?




-- 
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