deniskuzZ commented on code in PR #5621:
URL: https://github.com/apache/hive/pull/5621#discussion_r2017018773


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/compaction/evaluator/CompactionEvaluator.java:
##########
@@ -89,11 +90,27 @@ public boolean isEligibleForCompaction() {
         return isMinorNecessary();
       case MAJOR:
         return isMajorNecessary();
+      case SMART:
+        return isMinorNecessary() || isMajorNecessary();
       default:
         return false;
     }
   }
 
+  public CompactionType determineCompactionType() {
+    if (ci.type == CompactionType.SMART) {
+      if (isMajorNecessary()) {
+        return CompactionType.MAJOR;
+      } else if (isMinorNecessary()) {
+        return CompactionType.MINOR;
+      } else {
+        throw new RuntimeException("Unknown compaction type");

Review Comment:
   @difin, the else block is misleading. Why throw an "Unknown compaction type" 
when table is not eligible for compaction? 
   In this situation the compaction request status should be changed to REJECTED



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to