klion26 commented on code in PR #3665:
URL: https://github.com/apache/amoro/pull/3665#discussion_r2222233258


##########
amoro-ams/src/main/java/org/apache/amoro/server/optimizing/maintainer/IcebergTableMaintainer.java:
##########
@@ -1037,8 +1047,13 @@ private boolean canBeExpireByPartitionValue(
         }
 
         int compared = filePartitionValue.compareTo(partitionUpperBound);
-        Boolean compareResult =
-            expireField.type() == Types.StringType.get() ? compared <= 0 : 
compared < 0;
+        Boolean compareResult;

Review Comment:
   why do we add `DateType` to the special case? if the bound is the problem, 
could we calculate the bound with `(int) ((expireTimestamp + 24 * 60 * 60 * 
1000) +  / (24 * 60 * 60 * 1000))



##########
amoro-ams/src/main/java/org/apache/amoro/server/optimizing/maintainer/IcebergTableMaintainer.java:
##########
@@ -764,6 +764,9 @@ private Comparable<?> getExpireValue(
             .format(

Review Comment:
   Could you please help to add some comments for this function, thanks



##########
amoro-ams/src/test/java/org/apache/amoro/server/optimizing/maintainer/TestDataExpire.java:
##########
@@ -373,6 +416,10 @@ private void testUnKeyedFileLevel() {
       expected =
           Lists.newArrayList(
               createRecord(2, "222", parseMillis("2022-01-03T12:00:00"), 
"2022-01-03T12:00:00"));
+    } else if (expireByDate()) {

Review Comment:
   Could you please add some more tests to cover the bound case(eg, 
`2022-01-03T23:59:59`, `2022-01-03T00:00:00`, `2022-01-03T00:00:01`)



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