xylaaaaa opened a new pull request, #58755:
URL: https://github.com/apache/doris/pull/58755

   ### What problem does this PR solve?
   
   Issue Number: part of [Feature] Implement Remaining Iceberg Procedures #58199
   Related PR: N/A
   
   Problem Summary:
   This PR implements the `publish_changes` action for Iceberg tables. This 
action serves as the "Publish" step in the Write-Audit-Publish (WAP) pattern. 
The procedure locates a snapshot tagged with a specific `wap.id` property and 
cherry-picks it into the current table state. This allows users to atomically 
make "staged" data visible after validation.
   
   Syntax:
   ```sql
   EXECUTE TABLE catalog.db.table_name publish_changes("wap_id" = "batch_123");
   ````
   
   Output:
   Returns `previous_snapshot_id` (BIGINT) and `current_snapshot_id` (BIGINT) 
indicating the state transition.
   
   Use cases:
   
   1.  Implement Write-Audit-Publish (WAP) workflows.
   2.  Atomically publish validated data to the main branch.
   3.  Manage staged snapshots based on custom WAP IDs.
   
   ### Release note
   
   
[[Feature](https://www.google.com/search?q=iceberg)](https://www.google.com/search?q=iceberg)
 Support `publish_changes` action for Iceberg tables to enable WAP pattern.
   
   ### Check List (For Author)
   
     - Test
   
         - [ ] Regression test
         - [ ] Unit Test
         - [x] Manual test (add detailed scripts or steps below)
         - [ ] No need to test or manual test. Explain why:
             - [ ] This is a refactor/code format and no logic has been changed.
             - [ ] Previous test can cover this change.
             - [ ] No code files have been changed.
             - [ ] Other reason
   
       **Manual Test Scripts:**
   
       1.  Create an Iceberg table and write data with a specific `wap.id` 
property (generating a snapshot that is not current).
       2.  Verify that the newly written data is invisible in the default query.
       3.  Execute the action: `EXECUTE TABLE catalog.db.tbl 
publish_changes("wap_id" = "test_id");`
       4.  Check the result contains valid `previous_snapshot_id` and 
`current_snapshot_id`.
       5.  Query the table to verify the data is now visible.
   
     - Behavior changed:
   
         - [x] No.
         - [ ] Yes.
   
     - Does this need documentation?
   
         - [x] No.
         - [ ] Yes.
   
   ### Check List (For Reviewer who merge this PR)
   
     - [ ] Confirm the release note
     - [ ] Confirm test cases
     - [ ] Confirm document
     - [ ] Add branch pick label
   
   <!-- end list -->
   
   ```
   ```


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to