diff --git a/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java b/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java index 4d9c482a20da..b92940c54e55 100644 --- a/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java +++ b/paimon-hive/paimon-hive-catalog/src/main/java/org/apache/paimon/hive/HiveCatalog.java @@ -814,6 +814,12 @@ private Table newHmsTable( if (provider == null) { provider = "paimon"; } + CoreOptions coreOptions = CoreOptions.fromMap(tableParameters); + java.time.Duration partitionExpireTime = coreOptions.partitionExpireTime(); + int retention = Integer.MAX_VALUE; + if (partitionExpireTime != null && partitionExpireTime.getSeconds() <= Integer.MAX_VALUE) { + retention = (int) partitionExpireTime.getSeconds(); + } Table table = new Table( identifier.getTableName(), @@ -822,7 +828,7 @@ private Table newHmsTable( System.getProperty("user.name"), (int) (currentTimeMillis / 1000), (int) (currentTimeMillis / 1000), - Integer.MAX_VALUE, + retention, null, Collections.emptyList(), tableParameters,