Skip to content

[core] Skip manual-only tag groups in preview time travel - #10284

Open
LuciferYang wants to merge 2 commits into
apache:masterfrom
LuciferYang:m/core-102-tag-preview
Open

LuciferYang wants to merge 2 commits into
apache:masterfrom
LuciferYang:m/core-102-tag-preview

Conversation

@LuciferYang

Copy link
Copy Markdown
Contributor

Purpose

TagPreview.timeTravel's step-3 fallback streams every tagged snapshot's tag group through toOneAutoTag inside a .max(). toOneAutoTag calls checkAndGetOneAutoTag, which does checkState(autoTags.size() == 1), so a snapshot that has only manual tags (empty autoTags) throws IllegalStateException: There are more than 1 auto-created tags of the same snapshot: . — a misleading message, since there are zero. Because .max() evaluates every group, one manual-only group poisons the whole fallback: a preview target that genuinely can't be resolved throws that misleading error instead of the clean Cannot find snapshot or tag, and a valid auto tag <= the requested point living on another (often expired) tagged snapshot is never returned.

This makes toOneAutoTag return null for a manual-only group and filters nulls before .max(), so manual-only groups are skipped and the fallback resolves the best auto tag as intended.

This closes #10283.

Tests

  • testTimeTravelSkipsManualOnlySnapshots pins that a non-resolvable preview returns the clean Cannot find snapshot or tag error instead of the misleading auto-tag checkState.
  • testTimeTravelResolvesAutoTagDespiteManualOnlyGroup pins that a valid auto tag on an expired snapshot is still resolved when another snapshot has only a manual tag.

API and Format

No.

Documentation

No.

TagPreview.toOneAutoTag fed every snapshot's tag group into
checkAndGetOneAutoTag, whose size==1 state check threw for groups
holding only manually created tags, so a Hive preview query for a
partition older than every resolvable snapshot crashed with the
misleading 'more than 1 auto-created tags' error instead of the
intended cannot-find failure.

Return null for groups without auto-format tags and filter the nulls
in the stream.

Assisted-by: GLM-5.3
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.

Preview time travel throws on a manual-only tag group and fails to resolve a valid auto tag

1 participant