askwang commented on code in PR #4657:
URL: https://github.com/apache/paimon/pull/4657#discussion_r1889622739
##########
paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/procedure/ExpirePartitionsProcedure.java:
##########
@@ -75,21 +79,33 @@ public String identifier() {
String timestampFormatter,
String timestampPattern,
String expireStrategy,
- Integer maxExpires)
+ Integer maxExpires,
+ String options)
throws Catalog.TableNotExistException {
- FileStoreTable fileStoreTable = (FileStoreTable) table(tableId);
+ Map<String, String> dynamicOptions =
+ ProcedureUtils.fillInPartitionOptions(
+ expireStrategy,
+ timestampFormatter,
+ timestampPattern,
+ expirationTime,
+ maxExpires,
+ options);
+
+ Table table = table(tableId).copy(dynamicOptions);
+ FileStoreTable fileStoreTable = (FileStoreTable) table;
FileStore fileStore = fileStoreTable.store();
- Map<String, String> map = new HashMap<>();
- map.put(CoreOptions.PARTITION_EXPIRATION_STRATEGY.key(),
expireStrategy);
- map.put(CoreOptions.PARTITION_TIMESTAMP_FORMATTER.key(),
timestampFormatter);
- map.put(CoreOptions.PARTITION_TIMESTAMP_PATTERN.key(),
timestampPattern);
+
+ // check expiration time not null
+ Preconditions.checkNotNull(
+ fileStore.options().partitionExpireTime(),
+ "The partition expiration time is must been required, you can
set it by configuring the property 'partition.expiration-time' or adding the
'expiration_time' parameter in procedure. ");
PartitionExpire partitionExpire =
new PartitionExpire(
- TimeUtils.parseDuration(expirationTime),
+ fileStore.options().partitionExpireTime(),
Review Comment:
done, good idea
--
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]