voonhous commented on code in PR #20895:
URL: https://github.com/apache/hudi/pull/20895#discussion_r4717208886


##########
hudi-spark-datasource/hudi-spark3-common/src/main/scala/org/apache/spark/sql/hudi/command/MergeIntoHoodieTableCommand.scala:
##########
@@ -318,20 +319,86 @@ case class MergeIntoHoodieTableCommand(mergeInto: 
MergeIntoTable) extends Hoodie
 
   override def run(sparkSession: SparkSession): Seq[Row] = {
     this.sparkSession = sparkSession
-    // TODO move to analysis phase
-    // Create the write parameters
-    val props = buildMergeIntoConfig(hoodieCatalogTable)
-    validate(props)
-
-    val processedInputDf: DataFrame = getProcessedInputDf(props)
-    // Do the upsert
-    executeUpsert(processedInputDf, props)
-    // Refresh the table in the catalog
-    sparkSession.catalog.refreshTable(hoodieCatalogTable.table.qualifiedName)
+    if (hasPrimaryKey() && matchesNoRecord && indexFindsEveryKey) {

Review Comment:
   **blocker:** With `ON false`, `when not matched by source then delete` 
should remove every target row, but this path ignores the clause: on head `... 
on false when not matched then insert * when not matched by source then delete` 
keeps rows 1 and 2 and inserts 3, while master refuses the statement. #20840 is 
still open. 
   
   Note to self: Will review #20840 to unblock this PR.



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