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


##########
hudi-spark-datasource/hudi-spark-common/src/main/scala/org/apache/hudi/HoodieSparkSqlWriter.scala:
##########
@@ -118,6 +118,15 @@ object HoodieSparkSqlWriter {
 
       operation = WriteOperationType.INSERT
     }
+    // If no record key field and precombine field is provided, assume it's an 
append-only workload and do bulk insert
+    if (!hoodieConfig.contains(RECORDKEY_FIELD) && 
!hoodieConfig.contains(PRECOMBINE_FIELD) &&
+      operation == WriteOperationType.UPSERT) {
+
+      log.warn(s"$RECORDKEY_FIELD and $PRECOMBINE_FIELD is not specified " +
+        s"overriding the $OPERATION to be $BULK_INSERT_OPERATION_OPT_VAL")
+
+      operation = WriteOperationType.BULK_INSERT

Review Comment:
   you're right. i'm going to disable meta fields by default for this mode



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