Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions docs/docs/spark-writes.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ For more complex row-level updates based on incoming data, see the section on `M

## Writing to Branches

The branch must exist before performing write. Operations do **not** create the branch if it does not exist.
The target branch may be created during the write operation if it does not exist.
A branch can be created using [Spark DDL](spark-ddl.md#branching-and-tagging-ddl).

!!! info
Expand All @@ -229,7 +229,16 @@ A branch can be created using [Spark DDL](spark-ddl.md#branching-and-tagging-ddl
Branch writes can be performed by providing a branch identifier, `branch_yourBranch` in the operation.

Branch writes can also be performed as part of a write-audit-publish (WAP) workflow by specifying the `spark.wap.branch` config.
Note WAP branch and branch identifier cannot both be specified.

The target branch is resolved with the following precedence:

- The identifier and option branches can't conflict. If both are set, they must match.
- Identifier and option branches take priority over the session WAP branch.
- If neither the option nor the identifier branch is set and WAP is enabled for the table,
the WAP branch from the session SQL config is used.

!!! note
WAP ID and WAP branch cannot be set at the same time.

```sql
-- INSERT (1,' a') (2, 'b') into the audit branch.
Expand Down
Loading