Copilot commented on code in PR #2862:
URL: https://github.com/apache/fluss/pull/2862#discussion_r2930182023


##########
fluss-lake/fluss-lake-paimon/src/test/java/org/apache/fluss/lake/paimon/tiering/PaimonTieringTest.java:
##########
@@ -421,6 +430,66 @@ void testSnapshotExpiration(
         }
     }
 
+    @ParameterizedTest
+    @MethodSource("partitionExpireArgs")
+    void testPartitionExpiration(
+            boolean isTableAutoExpireSnapshot, boolean 
isLakeTieringExpireSnapshot)
+            throws Exception {
+        TablePath tablePath = TablePath.of("paimon", "test_partition_expire");
+        // Use a fixed ancient date so the partition is always considered 
expired.
+        // "20200101" with expiration-time=1d is always past-due – no 
wall-clock dependency.
+        String expiredPartition = "20200101";
+
+        Map<String, String> tableOptions = new HashMap<>();
+        tableOptions.put(CoreOptions.PARTITION_EXPIRATION_TIME.key(), "1 d");
+        
tableOptions.put(CoreOptions.PARTITION_EXPIRATION_CHECK_INTERVAL.key(), "10 
min");
+        tableOptions.put(CoreOptions.PARTITION_TIMESTAMP_FORMATTER.key(), 
"yyyyMMdd");

Review Comment:
   The inline comment says expiration-time=1d, but the test config sets 
`partition.expiration-time` to "1 d". Please align the comment with the actual 
configured value (or adjust the option value if the intended format is `1d`) to 
avoid confusion when reading/debugging the test.



##########
fluss-lake/fluss-lake-paimon/src/main/java/org/apache/fluss/lake/paimon/tiering/PaimonLakeCommitter.java:
##########
@@ -231,9 +231,23 @@ private FileStoreTable getTable(TablePath tablePath, 
boolean isAutoSnapshotExpir
             dynamicOptions.put(
                     CoreOptions.COMMIT_CALLBACKS.key(),
                     PaimonLakeCommitter.PaimonCommitCallback.class.getName());
+
+            boolean writeOnly = !isAutoSnapshotExpiration;
             dynamicOptions.put(
                     CoreOptions.WRITE_ONLY.key(),
-                    isAutoSnapshotExpiration ? Boolean.FALSE.toString() : 
Boolean.TRUE.toString());
+                    writeOnly ? Boolean.TRUE.toString() : 
Boolean.FALSE.toString());

Review Comment:
   This ternary is redundant since `writeOnly` is already a boolean. Consider 
using `Boolean.toString(writeOnly)` (or `String.valueOf(writeOnly)`) for 
clarity and to avoid unnecessary branching.



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