kbuci commented on code in PR #18302:
URL: https://github.com/apache/hudi/pull/18302#discussion_r2963312242


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieClusteringConfig.java:
##########
@@ -235,14 +237,49 @@ public class HoodieClusteringConfig extends HoodieConfig {
       .sinceVersion("0.7.0")
       .withDocumentation("Columns to sort the data by when clustering");
 
+  static final String SPARK_ALLOW_UPDATE_STRATEGY_CLASS_NAME =
+      
"org.apache.hudi.client.clustering.update.strategy.SparkAllowUpdateStrategy";
+
   public static final ConfigProperty<String> UPDATES_STRATEGY = ConfigProperty
       .key("hoodie.clustering.updates.strategy")
       
.defaultValue("org.apache.hudi.client.clustering.update.strategy.SparkRejectUpdateStrategy")
+      .withInferFunction(cfg -> {
+        String strategy = 
cfg.getStringOrDefault(HoodieLockConfig.WRITE_CONFLICT_RESOLUTION_STRATEGY_CLASS_NAME,
 "");
+        if 
(PreferWriterConflictResolutionStrategy.class.getName().equals(strategy)) {
+          return Option.of(SPARK_ALLOW_UPDATE_STRATEGY_CLASS_NAME);
+        }
+        return Option.empty();
+      })
       .markAdvanced()
       .sinceVersion("0.7.0")
       .withDocumentation("Determines how to handle updates, deletes to file 
groups that are under clustering."
           + " Default strategy just rejects the update");
 
+  public static final ConfigProperty<Boolean> ENABLE_EXPIRATIONS = 
ConfigProperty
+      .key("hoodie.clustering.enable.expirations")
+      .defaultValue(false)
+      .withInferFunction(cfg -> {
+        String strategy = 
cfg.getStringOrDefault(HoodieLockConfig.WRITE_CONFLICT_RESOLUTION_STRATEGY_CLASS_NAME,
 "");
+        if 
(PreferWriterConflictResolutionStrategy.class.getName().equals(strategy)) {
+          return Option.of(true);

Review Comment:
   Sure let me just make this default false then and not infer, since even 
though this is intended for preferred write conflict users, its technically 
orthogonal to that 



##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieClusteringConfig.java:
##########
@@ -235,14 +237,49 @@ public class HoodieClusteringConfig extends HoodieConfig {
       .sinceVersion("0.7.0")
       .withDocumentation("Columns to sort the data by when clustering");
 
+  static final String SPARK_ALLOW_UPDATE_STRATEGY_CLASS_NAME =
+      
"org.apache.hudi.client.clustering.update.strategy.SparkAllowUpdateStrategy";
+
   public static final ConfigProperty<String> UPDATES_STRATEGY = ConfigProperty
       .key("hoodie.clustering.updates.strategy")
       
.defaultValue("org.apache.hudi.client.clustering.update.strategy.SparkRejectUpdateStrategy")
+      .withInferFunction(cfg -> {
+        String strategy = 
cfg.getStringOrDefault(HoodieLockConfig.WRITE_CONFLICT_RESOLUTION_STRATEGY_CLASS_NAME,
 "");
+        if 
(PreferWriterConflictResolutionStrategy.class.getName().equals(strategy)) {
+          return Option.of(SPARK_ALLOW_UPDATE_STRATEGY_CLASS_NAME);
+        }
+        return Option.empty();
+      })
       .markAdvanced()
       .sinceVersion("0.7.0")
       .withDocumentation("Determines how to handle updates, deletes to file 
groups that are under clustering."
           + " Default strategy just rejects the update");
 
+  public static final ConfigProperty<Boolean> ENABLE_EXPIRATIONS = 
ConfigProperty
+      .key("hoodie.clustering.enable.expirations")
+      .defaultValue(false)
+      .withInferFunction(cfg -> {

Review Comment:
   removed infer func 
https://github.com/apache/hudi/pull/18302#discussion_r2963312242 



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