This is an automated email from the ASF dual-hosted git repository.
blue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iceberg.git
The following commit(s) were added to refs/heads/master by this push:
new 7b2b24063f Docs: Add expire_snapshots parameter snapshot_ids (#7028)
7b2b24063f is described below
commit 7b2b24063ff24ba96d603dc5478c39dd31eebff2
Author: Gustavo Torres <[email protected]>
AuthorDate: Mon Mar 6 12:07:29 2023 -0500
Docs: Add expire_snapshots parameter snapshot_ids (#7028)
---
docs/spark-procedures.md | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/docs/spark-procedures.md b/docs/spark-procedures.md
index 8bf4162ed0..c7343a3d7b 100644
--- a/docs/spark-procedures.md
+++ b/docs/spark-procedures.md
@@ -206,6 +206,7 @@ the `expire_snapshots` procedure will never remove files
which are still require
| `retain_last` | | int | Number of ancestor snapshots to preserve
regardless of `older_than` (defaults to 1) |
| `max_concurrent_deletes` | | int | Size of the thread pool used for
delete file actions (by default, no thread pool is used) |
| `stream_results` | | boolean | When true, deletion files will be
sent to Spark driver by RDD partition (by default, all the files will be sent
to Spark driver). This option is recommended to set to `true` to prevent Spark
driver OOM from large file size |
+| `snapshot_ids` | | array of long | Array of snapshot IDs to expire. |
If `older_than` and `retain_last` are omitted, the table's [expiration
properties](../configuration/#table-behavior-properties) will be used.
@@ -227,6 +228,12 @@ Remove snapshots older than specific day and time, but
retain the last 100 snaps
CALL hive_prod.system.expire_snapshots('db.sample', TIMESTAMP '2021-06-30
00:00:00.000', 100)
```
+Remove snapshots with snapshot ID `123` (note that this snapshot ID should not
be the current snapshot):
+
+```sql
+CALL hive_prod.system.expire_snapshots(table => 'db.sample', snapshot_ids =>
ARRAY(123))
+```
+
### `remove_orphan_files`
Used to remove files which are not referenced in any metadata files of an
Iceberg table and can thus be considered "orphaned".