fallintoplace commented on code in PR #2381:
URL: https://github.com/apache/iceberg-go/pull/2381#discussion_r4493379729
##########
website/src/api.md:
##########
@@ -359,6 +359,40 @@ newTbl, err = tbl.Overwrite(ctx, recordReader, nil,
`OverwriteTable` is the `arrow.Table` variant.
+### Dynamic partition overwrite
+
+Replace only the partitions present in the incoming data. Unlike a filtered
+row-level overwrite, this removes **all existing data files** in those
partitions
+while retaining files in other partitions.
+
+```go
+// Write Arrow record batches, replacing only partitions receiving new rows.
+newTbl, err := tbl.DynamicPartitionOverwrite(ctx, recordReader, nil)
+
+// In-memory Arrow tables work too.
+newTbl, err = tbl.DynamicPartitionOverwriteTable(ctx, arrowTbl, 1024, nil)
+
+// Or commit already-written Iceberg DataFile metadata through a transaction.
+txn := tbl.NewTransaction()
+err = txn.DynamicPartitionOverwriteDataFiles(ctx, newDataFiles, nil)
+if err == nil {
+ newTbl, err = txn.Commit(ctx)
+}
+```
+
+This supports Iceberg format v1-v3. Incoming files and all live files must
+use the current partition spec; tables with live older-spec files are rejected
+before Arrow data is written. For v3, replacement also removes deletion
+vectors tied to replaced data files. Unpartitioned tables are treated as one
+partition, and empty input leaves the table untouched.
Review Comment:
I will check here.
--
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]