LuciferYang opened a new pull request, #10284:
URL: https://github.com/apache/paimon/pull/10284

   ### 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.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to