Davis-Zhang-Onehouse commented on code in PR #12803:
URL: https://github.com/apache/hudi/pull/12803#discussion_r1945908711


##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/MergeIntoHoodieTableCommand.scala:
##########
@@ -843,17 +815,75 @@ case class MergeIntoHoodieTableCommand(mergeInto: 
MergeIntoTable) extends Hoodie
         "record key field",
         action.assignments)
       }))
+
+    val insertAssignments = insertActions.flatMap(_.assignments)
+    checkSchemaMergeIntoCompatibility(insertAssignments)
+  }
+
+  /**
+    * Check the merge into schema compatibility between the target table and 
the source table.
+    * The merge into schema compatibility requires data type matching for the 
following fields:
+    * 1. Partition key
+    * 2. Primary key
+    * 3. Pre-combine key
+    *
+    * @param assignments the assignment clause of the insert/update statement 
for figuring out
+    *                    the mapping between the target table and the source 
table.
+    */
+  private def checkSchemaMergeIntoCompatibility(assignments: Seq[Assignment]): 
Unit = {

Review Comment:
   removed the first commit



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

Reply via email to