rdblue commented on a change in pull request #2134:
URL: https://github.com/apache/iceberg/pull/2134#discussion_r562804340



##########
File path: 
spark3-extensions/src/main/scala/org/apache/spark/sql/catalyst/analysis/AlignMergeIntoTable.scala
##########
@@ -22,12 +22,13 @@ package org.apache.spark.sql.catalyst.analysis
 import org.apache.spark.sql.AnalysisException
 import org.apache.spark.sql.catalyst.plans.logical.{Assignment, DeleteAction, 
InsertAction, LogicalPlan, MergeIntoTable, UpdateAction}
 import org.apache.spark.sql.catalyst.rules.Rule
+import org.apache.spark.sql.catalyst.utils.AliasedIcebergTable
 import org.apache.spark.sql.internal.SQLConf
 
 case class AlignMergeIntoTable(conf: SQLConf) extends Rule[LogicalPlan] with 
AssignmentAlignmentSupport {
 
   override def apply(plan: LogicalPlan): LogicalPlan = plan resolveOperators {
-    case m: MergeIntoTable if m.resolved =>
+    case m@ MergeIntoTable(AliasedIcebergTable(_), _, _, _, _) if m.resolved =>

Review comment:
       I'm a little concerned about this change because it now depends on the 
number of arguments in `MergeIntoTable`. If Spark changes, then this rule would 
break.
   
   Instead, could you move the inner match inside the rule? Like this:
   
   ```scala
     case m: MergeIntoTable if m.resolved =>
       m.relation match {
         case IcebergRelation(rel) =>
           ...
         case _ =>
           m
       }
   ```




----------------------------------------------------------------
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:
us...@infra.apache.org



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

Reply via email to