From 101e65041ae09cb9aa24e14a4fa25da77856c912 Mon Sep 17 00:00:00 2001 From: Yuya Ebihara Date: Wed, 15 Jan 2025 20:02:13 +0900 Subject: [PATCH] Doc: Add Hive DELETE ORPHAN-FILES example (#11896) --- docs/docs/hive.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/docs/hive.md b/docs/docs/hive.md index a3cd79539c43..fd757cdd5122 100644 --- a/docs/docs/hive.md +++ b/docs/docs/hive.md @@ -785,6 +785,15 @@ Enter a query to expire snapshots having the following timestamp: `2021-12-09 05 ALTER TABLE test_table EXECUTE expire_snapshots('2021-12-09 05:39:18.689000000'); ``` +### `DELETE ORPHAN-FILES` + +Used to remove files which are not referenced in any metadata files of an Iceberg table and can thus be considered "orphaned". +The function is available with the following syntax: +```sql +ALTER TABLE table_a EXECUTE DELETE ORPHAN-FILES; +ALTER TABLE table_a EXECUTE DELETE ORPHAN-FILES OLDER THAN ('2021-12-09 05:39:18.689000000'); +``` + ### Type compatibility Hive and Iceberg support different set of types. Iceberg can perform type conversion automatically, but not for all