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

Conversation

YanZhangN
Copy link
Contributor

@YanZhangN YanZhangN commented Oct 23, 2024

Purpose

Add retention properties for hive metastore according to 'partition.expiration-time'.

Linked issue: close #xxx

Tests

API and Format

Documentation

@@ -814,6 +814,11 @@ 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

int retention =
coreOptions.partitionExpireTime() == null
? Integer.MAX_VALUE
: (int) coreOptions.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.

Is there a risk of data overflow here?
getSeconds return long, then cast int.

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

@JingsongLi
Copy link
Contributor

Can you provide the specific application of this attribute? For example, Hive first introduced it with JIRA, etc.

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.

@JingsongLi
Copy link
Contributor

I am not sure this field is for partition retention.

Maybe we can use properties to store this option.

@JingsongLi
Copy link
Contributor

Close this first, feel free to re-open this.

@JingsongLi JingsongLi closed this Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants