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

[spark] Adjust ExpireSnapshotsProcedure param type #4059

Merged
merged 3 commits into from
Sep 24, 2024

Conversation

askwang
Copy link
Contributor

@askwang askwang commented Aug 26, 2024

Purpose

  • change param older_than type from TimeStampType to StringType.

Tests

API and Format

Documentation

@askwang askwang closed this Sep 2, 2024
@askwang askwang reopened this Sep 2, 2024
@askwang
Copy link
Contributor Author

askwang commented Sep 2, 2024

help cc @JingsongLi

ProcedureParameter.optional("max_deletes", IntegerType)
ProcedureParameter.optional("older_than", StringType),
ProcedureParameter.optional("max_deletes", IntegerType),
ProcedureParameter.optional("time_retained", StringType)
Copy link
Contributor

Choose a reason for hiding this comment

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

older_than and time_retained? Looks not easy to understand, we should just keep one.

Copy link
Contributor

Choose a reason for hiding this comment

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

Because there is currently compatibility issue. I recommend using a script to address the issue of periodic calls when invoking from the outer layer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

older_than and time_retained? Looks not easy to understand, we should just keep one.

These two parameters can not be used together.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because there is currently compatibility issue. I recommend using a script to address the issue of periodic calls when invoking from the outer layer.

When using a script to calls periodically, we need to adjust older_than parameter each time. I think it is necessary to keep time_retained, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. @JingsongLi Removed time_retained

Duration.ofMillis(System.currentTimeMillis() - olderThanMills));
if (!StringUtils.isNullOrWhitespaceOnly(olderThanStr)) {
long olderThanMills;
// forward compatibility for timestamp type
Copy link
Contributor

Choose a reason for hiding this comment

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

How to forward compatibility for timestamp type? It is a string instead of a timestamp.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In default, the value of timestamp type is like "1724664000000", it's actually a string that contains numerics. And get it by
Long olderThanMills = args.isNullAt(3) ? null : args.getLong(3) / 1000;

Copy link
Contributor

Choose a reason for hiding this comment

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

change param older_than type from TimeStampType to StringType, TimeStampType is not easy to understand and use.

Is this related? Can you show the use cases? How to improve the usage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got, has only retain StringType

Copy link
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

+1

@JingsongLi JingsongLi merged commit d0b7e97 into apache:master Sep 24, 2024
10 checks passed
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.

2 participants