Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[hive]add retention seconds in hive catalog. #4367

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,12 @@ private Table newHmsTable(
if (provider == null) {
provider = "paimon";
}
CoreOptions coreOptions = CoreOptions.fromMap(tableParameters);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duration partitionExpireTime = coreOptions.partitionExpireTime();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

java.time.Duration partitionExpireTime = coreOptions.partitionExpireTime();
int retention = Integer.MAX_VALUE;
if (partitionExpireTime != null && partitionExpireTime.getSeconds() <= Integer.MAX_VALUE) {
retention = (int) partitionExpireTime.getSeconds();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe only set it with metastore.partitioned-table enabled.

}
Table table =
new Table(
identifier.getTableName(),
Expand All @@ -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,
Expand Down
Loading