JingsongLi commented on code in PR #10766:
URL: https://github.com/apache/paimon/pull/10766#discussion_r4374094478
##########
paimon-api/src/main/java/org/apache/paimon/CoreOptions.java:
##########
@@ -1457,6 +1457,17 @@ public String toString() {
.defaultValue(100)
.withDescription("The default deleted num of partition
expiration.");
+ public static final ConfigOption<Boolean>
PARTITION_EXPIRATION_RETAIN_LATEST =
+ key("partition.expiration-retain-latest")
Review Comment:
[P1] Propagate the safeguard into the Flink expiration action
The supported `ExpirePartitionsAction` copies table configuration into its
table, but constructs `PartitionExpireStrategy` from a separate map containing
only strategy/formatter/pattern. Consequently the new strategy constructors
always see retain-latest=false there, even if it is persisted on the table and
explicitly supplied through the action's table-conf map.
I reproduced this with a real filesystem table containing only
`dt=20010101`, TTL `1 d`, formatter `yyyyMMdd`, and retain-latest=true.
`table.store().newPartitionExpire(...).expire(...)` leaves its one row; the
actual Flink `ExpirePartitionsAction.executeLocally()` with the same safeguard
explicitly true deletes it and leaves an empty table. This is age-based
expiration, not the explicit DROP/TRUNCATE exception documented below.
Please build the action's strategy options from the table/configured options
before applying its CLI overrides, or explicitly propagate this option, and add
an action-level regression that keeps the sole expired partition.
--
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]