Skip to content

[spark] Introduce plan-auto-tag-for-read for Spark read#7897

Merged
JingsongLi merged 2 commits into
apache:masterfrom
JingsongLi:read_tag
May 20, 2026
Merged

[spark] Introduce plan-auto-tag-for-read for Spark read#7897
JingsongLi merged 2 commits into
apache:masterfrom
JingsongLi:read_tag

Conversation

@JingsongLi
Copy link
Copy Markdown
Contributor

Purpose

Introduce 'scan.plan-auto-tag-for-read.time-retained' option:

When set, a temporary tag will be auto-created during batch scan planning to protect the read snapshot from expiration. The value specifies the tag's TTL. Should be longer than the longest expected batch read duration.

Tests

public void deleteReadTag(String tagName) {
try {
if (tagManager.tagExists(tagName)) {
snapshotManager.fileIO().deleteQuietly(tagManager.tagPath(tagName));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this intentionally deleting only the tag meta file instead of calling table.deleteTag(tagName) to
keep read cleanup lightweight

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Directly delete the tag metadata file instead of using TagManager.deleteTag(), which would also scan and delete unreferenced data files — too heavyweight for a read-path cleanup. Any orphan data files left behind will be reclaimed by OrphanFilesClean.

Commented in 1d4a461

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Got it.

@XiaoHongbo-Hope
Copy link
Copy Markdown
Contributor

+1

Copy link
Copy Markdown
Contributor

@Zouxxyy Zouxxyy 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 b352de5 into apache:master May 20, 2026
12 of 13 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.

3 participants