imback82 commented on a change in pull request #27243: [SPARK-30535][SQL] 
Migrate ALTER TABLE commands to the new framework
URL: https://github.com/apache/spark/pull/27243#discussion_r368325720
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/v2Commands.scala
 ##########
 @@ -394,13 +395,14 @@ case class DropTable(
     ifExists: Boolean) extends Command
 
 /**
- * The logical plan of the ALTER TABLE command that works for v2 tables.
+ * The base class for ALTER TABLE commands that work for v2 tables.
  */
-case class AlterTable(
-    catalog: TableCatalog,
-    ident: Identifier,
-    table: NamedRelation,
-    changes: Seq[TableChange]) extends Command {
+abstract class AlterTable extends Command {
+  def table: LogicalPlan
+
+  def changes: Seq[TableChange]
+
+  override def children: Seq[LogicalPlan] = Seq(table)
 
   override lazy val resolved: Boolean = table.resolved && {
     changes.forall {
 
 Review comment:
   Currently, `changes` will be triggered even though the resolved table is 
`V1Table` because `ResolveSessionCatalog` runs at the end (`resolved` is called 
before `V1Table` is handled). Should we check if table is not `V1Table` here or 
extra computation is fine for simplicity?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to