nastra commented on code in PR #8216:
URL: https://github.com/apache/iceberg/pull/8216#discussion_r1282722807


##########
docs/spark-ddl.md:
##########
@@ -477,27 +477,50 @@ Note that although the identifier is removed, the column 
will still exist in the
 
 #### `ALTER TABLE ... CREATE BRANCH`
 
-Branches can be created via the `CREATE BRANCH` statement, which includes 
-the snapshot to create the branch at and an optional retention clause.
+Branches can be created via the `CREATE BRANCH` statement with following 
options
+* Do not fail if the branch already exists with `IF NOT EXISTS`
+* Update the branch if it already exists with `CREATE OR REPLACE`
+* Create at a snapshot
+* Create with retention
 
 ```sql
+-- CREATE audit-branch at current snapshot with default retention.
+ALTER TABLE prod.db.sample CREATE BRANCH `audit-branch`
+
+-- CREATE audit-branch at current snapshot with default retention if it 
doesn't exist.
+ALTER TABLE prod.db.sample CREATE BRANCH IF NOT EXISTS `audit-branch`
+
+-- CREATE or REPLACE audit-branch at current snapshot with default retention 
or REPLACE it if already exists.

Review Comment:
   ```suggestion
   -- CREATE audit-branch at current snapshot with default retention or REPLACE 
it if it already exists.
   ```



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