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] Enable TagCreationMode#batch for spark writer #5185

Merged
merged 4 commits into from
Mar 1, 2025

Conversation

Aitozi
Copy link
Contributor

@Aitozi Aitozi commented Feb 28, 2025

Purpose

Linked issue: close #5181

Tests

API and Format

Documentation

private def preFinish(commitMessages: Seq[CommitMessage]): Unit = {
val coreOptions = table.coreOptions();
if (coreOptions.tagCreationMode() == TagCreationMode.BATCH) {
val tagCreation = new TagBatchCreation(table)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a little more concise : if (table.coreOptions().tagCreationMode() == TagCreationMode.BATCH)

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

}
markDoneIfNeeded(commitMessages)
}

private def markDoneIfNeeded(commitMessages: Seq[CommitMessage]): Unit = {
val coreOptions = table.coreOptions()
if (coreOptions.toConfiguration.get(CoreOptions.PARTITION_MARK_DONE_WHEN_END_INPUT)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this option is used several times, I think it's ok here

Copy link
Contributor

Choose a reason for hiding this comment

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

My mistake.

if (tagManager.tagExists(tagName)) {
tagManager.deleteTag(
tagName, tagDeletion, snapshotManager, table.store().createTagCallbacks());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Waring-Logs should be printed here.

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

table.store().createTagCallbacks(),
false);
} catch (Exception e) {
LOG.warn("Failed to create tag", e);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion : Failed to create tag '${tagname}' from '${snapshot}', you can create this tag manually.

@LinMingQiang
Copy link
Contributor

+1

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 1004cca into apache:master Mar 1, 2025
12 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.

[Feature] TagCreationMode#batch should also work for spark writer
3 participants