codope commented on code in PR #12296:
URL: https://github.com/apache/hudi/pull/12296#discussion_r1853198100


##########
hudi-spark-datasource/hudi-spark/src/main/scala/org/apache/spark/sql/hudi/command/IndexCommands.scala:
##########
@@ -51,6 +53,15 @@ case class CreateIndexCommand(table: CatalogTable,
       new util.LinkedHashMap[String, java.util.Map[String, String]]()
     columns.map(c => columnsMap.put(c._1.mkString("."), c._2.asJava))
 
+    // validate that only overwrite with latest payloads can enabled SI
+    if (indexType.equals("secondary_index")) {
+      // do additional validation
+      if ((metaClient.getTableConfig.getPayloadClass != null && 
!(metaClient.getTableConfig.getPayloadClass.equals(classOf[OverwriteWithLatestAvroPayload].getCanonicalName)))
+        || (metaClient.getTableConfig.getRecordMergeMode ne 
RecordMergeMode.OVERWRITE_WITH_LATEST)) {

Review Comment:
   Should we also consider `DefaultHoodieRecordPayload` if event time field is 
not specified?



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