You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2020/04/09 05:01:07 UTC

[GitHub] [incubator-hudi] vinothchandar commented on a change in pull request #1495: [HUDI-770] Organize upsert/insert API implementation under a single package

vinothchandar commented on a change in pull request #1495: [HUDI-770] Organize upsert/insert API implementation under a single package
URL: https://github.com/apache/incubator-hudi/pull/1495#discussion_r405956442
 
 

 ##########
 File path: hudi-common/src/main/java/org/apache/hudi/common/model/WriteOperationType.java
 ##########
 @@ -27,23 +27,25 @@
  */
 public enum WriteOperationType {
   // directly insert
-  INSERT("insert"),
-  INSERT_PREPPED("insert_prepped"),
+  INSERT("insert", false),
+  INSERT_PREPPED("insert_prepped", false),
   // update and insert
-  UPSERT("upsert"),
-  UPSERT_PREPPED("upsert_prepped"),
+  UPSERT("upsert", true),
+  UPSERT_PREPPED("upsert_prepped", true),
   // bulk insert
-  BULK_INSERT("bulk_insert"),
-  BULK_INSERT_PREPPED("bulk_insert_prepped"),
+  BULK_INSERT("bulk_insert", false),
+  BULK_INSERT_PREPPED("bulk_insert_prepped", false),
   // delete
-  DELETE("delete"),
+  DELETE("delete", true),
   // used for old version
-  UNKNOWN("unknown");
+  UNKNOWN("unknown", false);
 
   private final String value;
+  private final boolean isUpsert;
 
-  WriteOperationType(String value) {
+  WriteOperationType(String value, boolean isUpsert) {
 
 Review comment:
   is nt this really debt? can we get rid of this boolean and just replace with a helper method that takes in the operation type and returns true/false?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services