-
Notifications
You must be signed in to change notification settings - Fork 988
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
[core] Unify the order of procedure loading properties #4657
base: master
Are you sure you want to change the base?
Conversation
throws Catalog.TableNotExistException { | ||
FileStoreTable fileStoreTable = (FileStoreTable) table(tableId); | ||
Map<String, String> dynamicOptions = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These code is same as three ExpirePartitionsProcedure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thks, added a unified util method.
|
||
PartitionExpire partitionExpire = | ||
new PartitionExpire( | ||
TimeUtils.parseDuration(expirationTime), | ||
fileStore.options().partitionExpireTime(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use newPartitionExpire
in FileStore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, good idea
map.put(CoreOptions.PARTITION_TIMESTAMP_PATTERN.key(), timestampPattern); | ||
|
||
// check expiration time not null | ||
Preconditions.checkNotNull( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this maybe can be checked in FileStore internal
CoreOptions tableOptions = ((FileStoreTable) table).store().options(); | ||
ExpireConfig.Builder builder = | ||
ProcedureUtils.fillInSnapshotOptions( | ||
tableOptions, retainMax, retainMin, olderThanStr, maxDeletes); | ||
int deleted = expireSnapshots.config(builder.build()).expire(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
table.newExpireSnapshots()
should include the dynamicOptions instead of inserting it through the builder, if not maybe we should fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right. We should not update properties using the builder after table.newExpireSnapshots()
which should included in dynamicOptions.
I will remove the builder way in another pr, WDYT? @Zouxxyy
75a3ae3
to
a6aa2be
Compare
Purpose
If the table property have related properties, we do not need to configure them separately in procedure, unify them for expire_partitions and expire_snapshots.
Tests
API and Format
Documentation