hililiwei opened a new pull request, #5535:
URL: https://github.com/apache/iceberg/pull/5535

   Co-authored-by: liliwei [[email protected]](mailto:[email protected])
   Co-authored-by: xuwei [[email protected]](mailto:[email protected])
   Co-authored-by: chidayong 
[[email protected]](mailto:[email protected])
   
   base on https://github.com/apache/iceberg/pull/5209#issuecomment-1184719859, 
 Split https://github.com/apache/iceberg/pull/5209 into TAG and Branch
   
   ## What is the purpose of the change
   Implement the syntax in the following documents:
   
https://docs.google.com/document/d/1tbATFPrKF3vNlzkgZQdaW8CAJmbjvryfrlg6C2Ci_aA/edit
   
   
   ### DDLs for Branch and Retention 
   
   #### Create  Branches
   ```sql
   ALTER TABLE tableName
   {CREATE | REPLACE} BRANCH branchName [AS OF {VERSION snapshotId}]
   [WITH SNAPSHOT RETENTION {[num_snapshots SNAPSHOTS]
   [interval {MONTHS | DAYS | HOURS | MINUTES}]}]}]
   [RETAIN interval {MONTHS | DAYS | HOURS | MINUTES}]
   
   ALTER TABLE prod.db.my_table 
   CREATE BRANCH test_branch AS OF VERSION 100 WITH SNAPSHOT RETENTION 5
   SNAPSHOTS 7 DAYS
   RETAIN 12 MONTHS
   
   ```
   
   #### Drop Branches
   
   ```sql
   ALTER TABLE table DROP BRANCH reference
   ```
   #### Updating Branch Snapshot Retention
   
   ```sql
   ALTER TABLE table 
   ALTER BRANCH branchName
   SET SNAPSHOT RETENTION
   {[numSnapshots SNAPSHOTS] [interval {MONTHS | DAYS | HOURS | MINUTES}]}
   
   
   ALTER TABLE prod.db.my_table 
   ALTER BRANCH branchName
   SET SNAPSHOT RETENTION
   5 SNAPSHOTS 10 DAYS
   ```
   
   #### Update Retention for Branches
   ```sql
   ALTER TABLE table 
   ALTER BRANCH refName
   RETAIN interval {MONTHS | DAYS | HOURS | MINUTES}
   ```
   
   #### Rename Branches
   ```sql
   ALTER TABLE table RENAME BRANCH oldBranch TO newBranch
   ```
   
   


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