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


##########
hudi-spark-datasource/hudi-spark3-common/src/main/scala/org/apache/spark/sql/hudi/command/MergeIntoHoodieTableCommand.scala:
##########
@@ -581,6 +599,22 @@ case class MergeIntoHoodieTableCommand(mergeInto: 
MergeIntoTable) extends Hoodie
     }
   }
 
+  /**
+   * Whether more than one source row matching the same target row fails the 
statement. As in Spark, that applies
+   * when a matched clause other than a single unconditional delete can act on 
the target row. Unless set, the check
+   * is on only for a table of a non-native table format, as a native table 
combined such source rows before it. The
+   * format is the one the table loads, which is native for a name that no 
table format implementation answers to.
+   */
+  private def shouldCheckCardinality(parameters: Map[String, String]): Boolean 
= {
+    
parameters.get(MERGE_INTO_CARDINALITY_CHECK.key).map(_.toBoolean).getOrElse(
+      hoodieCatalogTable.metaClient.getTableFormat.getName != 
NativeTableFormat.TABLE_FORMAT) &&

Review Comment:
   Side note, not blocking, this is for my own tracking: 
   this is the first user-visible default keyed on `hoodie.table.format` (on 
master it only gates internal paths, TimelineArchiverV2:241 and 
CopyOnWriteRollbackActionExecutor:78), and #20890 adds a second one. 
   
   Since only `NativeTableFormat` ships in-tree the default-on branch is 
unreachable for now, so this can be a follow-up: could the two eventually share 
one helper such as `HoodieTableFormat#isNative`, and the config doc state that 
the default is on only for non-native formats?



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