jackylee-ch opened a new pull request, #10199:
URL: https://github.com/apache/paimon/pull/10199

   ## Purpose
   
   Spark's `rollback` drops every snapshot and tag created after the target, so 
a
   user who only wants to restore an earlier state loses the newer history. 
Flink
   already exposes `rollback_to_as_latest`, which rolls the target forward as a
   new latest snapshot non-destructively (core `rollbackToAsLatest`, #8450), but
   Spark has no equivalent.
   
   ## Change
   
   Add `RollbackToAsLatestProcedure`, registered as `rollback_to_as_latest`,
   taking exactly one of `tag` / `snapshot_id`. It mirrors the Flink procedure:
   resolve the target snapshot (creating a protection tag for the snapshot_id
   path), `commit.rollbackToAsLatest(tag)`, and clean that tag up if the commit
   did not land. Returns previous / rolled_back / current snapshot ids.
   
   ## Tests
   
   `RollbackToAsLatestProcedureTest` writes three snapshots, rolls back to
   snapshot 1 as latest and asserts snapshots 2 and 3 survive (non-destructive)
   and the data is snapshot 1's, then rolls forward to snapshot 3.
   
   Written with Claude Code; verification is mine.
   


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