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


##########
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) {

Review Comment:
   i think if users intentionally set a particular operation type we should 
fail fast. Here, instead of checking for upsert operation type, we should be 
checking whether the user set no operation type.



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