aokolnychyi commented on code in PR #55518:
URL: https://github.com/apache/spark/pull/55518#discussion_r3785929879


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/RewriteRowLevelCommand.scala:
##########
@@ -129,6 +156,17 @@ trait RewriteRowLevelCommand extends Rule[LogicalPlan] {
     V2ExpressionUtils.resolveRef[AttributeReference](FieldReference(name), 
plan)
   }
 
+  protected def isIdentityAssignment(key: Attribute, value: Expression): 
Boolean = {
+    val unwrapped = value match {
+      case Alias(child, _) => child
+      case other => other
+    }
+    unwrapped match {
+      case attr: Attribute => AttributeSet(Seq(key)).contains(attr)

Review Comment:
   It is a bit odd to see AttributeSet being used here? Can we do this instead?
   
   ```
   protected def isIdentityAssignment(key: Attribute, value: Expression): 
Boolean = {
     val valueWithoutAlias = value match {
       case Alias(child, _) => child
       case other => other
     }
     key.semanticEquals(valueWithoutAlias)
   }
   ```



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