beyond1920 commented on code in PR #8597:
URL: https://github.com/apache/hudi/pull/8597#discussion_r1190574858


##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/MergeIntoHoodieTableCommand.scala:
##########
@@ -467,11 +471,19 @@ case class MergeIntoHoodieTableCommand(mergeInto: 
MergeIntoTable) extends Hoodie
           case None =>
             // In case partial assignments are allowed and there's no 
corresponding conditional assignment,
             // create a self-assignment for the target table's attribute
-            if (allowPartialAssignments) {
-              Assignment(attr, attr)
-            } else {
-              throw new AnalysisException(s"Assignment expressions have to 
assign every attribute of target table " +
-                s"(provided: `${assignments.map(_.sql).mkString(",")}`")
+            partialAssigmentMode match {
+              case Some(mode) =>
+                mode match {
+                  case PartialAssignmentMode.NULL_VALUE =>
+                    Assignment(attr, Literal(null))
+                  case PartialAssignmentMode.ORIGINAL_VALUE =>
+                    Assignment(attr, attr)
+                  case PartialAssignmentMode.DEFAULT_VALUE =>
+                    Assignment(attr, Literal.default(attr.dataType))
+                }
+              case _ =>
+                throw new AnalysisException(s"Assignment expressions have to 
assign every attribute of target table " +

Review Comment:
   `Delete` would not hit this branch.
   
![image](https://github.com/apache/hudi/assets/1525333/8917cb76-fc4d-4077-9a17-39f7e6d89a8a)
   
![image](https://github.com/apache/hudi/assets/1525333/b642f4ef-fc5a-4dd1-a87a-dc27553f886c)
   



-- 
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: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to