xxubai commented on code in PR #4324:
URL: https://github.com/apache/amoro/pull/4324#discussion_r3802917866


##########
amoro-format-iceberg/src/main/java/org/apache/amoro/table/TableProperties.java:
##########
@@ -104,7 +105,8 @@ private TableProperties() {}
   public static final long SELF_OPTIMIZING_MAX_TASK_SIZE_DEFAULT = 134217728; 
// 128 MB
 
   public static final String SELF_OPTIMIZING_FRAGMENT_RATIO = 
"self-optimizing.fragment-ratio";
-  public static final int SELF_OPTIMIZING_FRAGMENT_RATIO_DEFAULT = 8;
+  public static final int SELF_OPTIMIZING_FRAGMENT_RATIO_DEFAULT =

Review Comment:
   ```suggestion
     public static final int SELF_OPTIMIZING_FRAGMENT_RATIO_DEFAULT = 8;
   ```



##########
amoro-common/src/main/java/org/apache/amoro/config/OptimizingConfig.java:
##########
@@ -26,6 +26,8 @@
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class OptimizingConfig {
 
+  public static final int DEFAULT_FRAGMENT_RATIO = 8;

Review Comment:
   Why define the defaut value there



##########
amoro-common/src/main/java/org/apache/amoro/config/OptimizingConfig.java:
##########
@@ -226,7 +228,8 @@ public OptimizingConfig setMinTargetSizeRatio(double 
minTargetSizeRatio) {
   }
 
   public long maxFragmentSize() {
-    return targetSize / fragmentRatio;
+    int effectiveFragmentRatio = fragmentRatio > 0 ? fragmentRatio : 
DEFAULT_FRAGMENT_RATIO;
+    return targetSize / effectiveFragmentRatio;

Review Comment:
   ```suggestion
       return targetSize / Math.max(1, fragmentRatio);
   ```



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