Skip to content
Open
Show file tree
Hide file tree
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
16 changes: 16 additions & 0 deletions docs/en/sql-reference/statements/alter/partition.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,22 @@ ALTER TABLE mt DROP PARTITION '2020-11-21';
ALTER TABLE mt DROP PART 'all_4_4_0';
```

On Iceberg tables, `DROP PARTITION` drops the partition by writing a new snapshot with the partition data files excluded.

By default, no parquet files are physically deleted from object storage.
The `iceberg_delete_data_on_drop` option must be enabled for data files to be purged.

:::note
Purging data files will break time travel to older snapshots that reference that partition.
:::

Example purging data files:

```sql
ALTER TABLE mt DROP PARTITION tuple(toRelativeDayNum(toDate('2026-01-01')))
SETTINGS iceberg_delete_data_on_drop = 1;
```

## DROP DETACHED PARTITION\|PART {#drop-detached-partitionpart}

```sql
Expand Down
9 changes: 9 additions & 0 deletions src/Storages/ObjectStorage/DataLakes/IDataLakeMetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,15 @@ class IDataLakeMetadata : boost::noncopyable
ContextPtr /*context*/,
const StorageID & /*storage_id*/,
std::shared_ptr<DataLake::ICatalog> /*catalog*/) { throwNotImplemented("alter"); }
virtual bool supportsDropPartition() const { return false; }
virtual void dropPartition(
const ASTPtr & /* partition */,
ContextPtr /* context */,
std::shared_ptr<DataLake::ICatalog> /* catalog */,
const StorageID & /* storage_id */)
{
throwNotImplemented("dropPartition");
}

virtual Pipe executeCommand(
const String & command_name,
Expand Down
Loading
Loading