This is an automated email from the ASF dual-hosted git repository.

xuba pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/amoro.git


The following commit(s) were added to refs/heads/master by this push:
     new ddd4ec46d [AMORO-3806] Fix a ArithmeticException when calculating 
health score (#3807)
ddd4ec46d is described below

commit ddd4ec46dc300f9189c7f2d30bcf9bcafb0b9b13
Author: ZhouJinsong <[email protected]>
AuthorDate: Thu Oct 2 14:58:45 2025 +0800

    [AMORO-3806] Fix a ArithmeticException when calculating health score (#3807)
    
    Fix the / by zero issue
---
 .../java/org/apache/amoro/optimizing/plan/CommonPartitionEvaluator.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/amoro-format-iceberg/src/main/java/org/apache/amoro/optimizing/plan/CommonPartitionEvaluator.java
 
b/amoro-format-iceberg/src/main/java/org/apache/amoro/optimizing/plan/CommonPartitionEvaluator.java
index a806cec1b..7f1f44b19 100644
--- 
a/amoro-format-iceberg/src/main/java/org/apache/amoro/optimizing/plan/CommonPartitionEvaluator.java
+++ 
b/amoro-format-iceberg/src/main/java/org/apache/amoro/optimizing/plan/CommonPartitionEvaluator.java
@@ -398,7 +398,7 @@ public class CommonPartitionEvaluator implements 
PartitionEvaluator {
     long dataFiles = getFragmentFileCount() + getSegmentFileCount();
     long dataRecords = getFragmentFileRecords() + getSegmentFileRecords();
 
-    double averageDataFileSize = dataFilesSize / dataFiles;
+    double averageDataFileSize = dataFiles > 0 ? (double) dataFilesSize / 
dataFiles : 0;
     double eqDeleteRatio = getNormalizedRatio(equalityDeleteFileRecords, 
dataRecords);
     double posDeleteRatio = getNormalizedRatio(posDeleteFileRecords, 
dataRecords);
 

Reply via email to