lw309637554 commented on a change in pull request #2136:
URL: https://github.com/apache/hudi/pull/2136#discussion_r527732807



##########
File path: 
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/HoodieIndexUtils.java
##########
@@ -85,4 +91,61 @@ public static HoodieRecord getTaggedRecord(HoodieRecord 
inputRecord, Option<Hood
     }
     return record;
   }
+
+  /**
+   * Check compatible between new writeIndexType and indexType already in 
hoodie.properties.
+   * @param writeIndexType new indexType
+   * @param persistIndexType indexType already in hoodie.properties
+   */
+  public static void checkIndexTypeCompatible(IndexType writeIndexType, 
IndexType persistIndexType) {

Review comment:
       done

##########
File path: 
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/HoodieIndexUtils.java
##########
@@ -85,4 +91,61 @@ public static HoodieRecord getTaggedRecord(HoodieRecord 
inputRecord, Option<Hood
     }
     return record;
   }
+
+  /**
+   * Check compatible between new writeIndexType and indexType already in 
hoodie.properties.
+   * @param writeIndexType new indexType
+   * @param persistIndexType indexType already in hoodie.properties
+   */
+  public static void checkIndexTypeCompatible(IndexType writeIndexType, 
IndexType persistIndexType) {
+    boolean isTypeCompatible = false;
+    switch (persistIndexType) {
+      case GLOBAL_BLOOM:
+        if (writeIndexType.equals(IndexType.GLOBAL_BLOOM)
+            || writeIndexType.equals(IndexType.BLOOM)
+            || writeIndexType.equals(IndexType.SIMPLE)
+            || writeIndexType.equals(IndexType.GLOBAL_SIMPLE)) {
+          isTypeCompatible = true;
+        }
+        break;
+      case GLOBAL_SIMPLE:
+        if (writeIndexType.equals(IndexType.GLOBAL_SIMPLE)

Review comment:
       done

##########
File path: 
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/HoodieIndexUtils.java
##########
@@ -85,4 +91,61 @@ public static HoodieRecord getTaggedRecord(HoodieRecord 
inputRecord, Option<Hood
     }
     return record;
   }
+
+  /**
+   * Check compatible between new writeIndexType and indexType already in 
hoodie.properties.
+   * @param writeIndexType new indexType
+   * @param persistIndexType indexType already in hoodie.properties
+   */
+  public static void checkIndexTypeCompatible(IndexType writeIndexType, 
IndexType persistIndexType) {
+    boolean isTypeCompatible = false;
+    switch (persistIndexType) {
+      case GLOBAL_BLOOM:
+        if (writeIndexType.equals(IndexType.GLOBAL_BLOOM)
+            || writeIndexType.equals(IndexType.BLOOM)
+            || writeIndexType.equals(IndexType.SIMPLE)
+            || writeIndexType.equals(IndexType.GLOBAL_SIMPLE)) {
+          isTypeCompatible = true;
+        }
+        break;
+      case GLOBAL_SIMPLE:
+        if (writeIndexType.equals(IndexType.GLOBAL_SIMPLE)
+            || writeIndexType.equals(IndexType.GLOBAL_BLOOM)) {
+          isTypeCompatible = true;
+        }
+        break;
+      case SIMPLE:
+        if (writeIndexType.equals(IndexType.SIMPLE)) {
+          isTypeCompatible = true;
+        }
+        break;
+      case BLOOM:
+        if (writeIndexType.equals(IndexType.BLOOM)) {
+          isTypeCompatible = true;

Review comment:
       done

##########
File path: 
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/index/HoodieIndexUtils.java
##########
@@ -85,4 +91,61 @@ public static HoodieRecord getTaggedRecord(HoodieRecord 
inputRecord, Option<Hood
     }
     return record;
   }
+
+  /**
+   * Check compatible between new writeIndexType and indexType already in 
hoodie.properties.
+   * @param writeIndexType new indexType
+   * @param persistIndexType indexType already in hoodie.properties
+   */
+  public static void checkIndexTypeCompatible(IndexType writeIndexType, 
IndexType persistIndexType) {
+    boolean isTypeCompatible = false;
+    switch (persistIndexType) {
+      case GLOBAL_BLOOM:
+        if (writeIndexType.equals(IndexType.GLOBAL_BLOOM)
+            || writeIndexType.equals(IndexType.BLOOM)
+            || writeIndexType.equals(IndexType.SIMPLE)
+            || writeIndexType.equals(IndexType.GLOBAL_SIMPLE)) {
+          isTypeCompatible = true;
+        }
+        break;
+      case GLOBAL_SIMPLE:
+        if (writeIndexType.equals(IndexType.GLOBAL_SIMPLE)
+            || writeIndexType.equals(IndexType.GLOBAL_BLOOM)) {
+          isTypeCompatible = true;
+        }
+        break;
+      case SIMPLE:
+        if (writeIndexType.equals(IndexType.SIMPLE)) {

Review comment:
       done




----------------------------------------------------------------
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:
[email protected]


Reply via email to