<@U0A71G31CDV> can I run drop table purge on icebe...
# questions-and-troubleshooting
z
@Rocky can I run drop table purge on iceberg table from starrocks? to delete its refernced files as well?
r
Yes, you can drop an Iceberg table and delete its data files from StarRocks, but you should use the
FORCE
keyword instead of
PURGE
. In StarRocks (v3.1 and later), the
DROP TABLE
behavior for Iceberg tables is as follows: *
DROP TABLE <table_name>
: This only removes the table metadata from the Iceberg catalog. By default, the underlying data files and the file path in remote storage (S3/HDFS) are not deleted. *
DROP TABLE <table_name> FORCE
: This deletes the table data in the remote storage while typically retaining the root file path directory. Example
Copy code
sql
-- This will drop the metadata and delete the referenced data files
DROP TABLE iceberg_catalog.iceberg_db.my_table FORCE;
Important Notes: 1. Version Requirement: This DDL feature for Iceberg is supported starting from StarRocks v3.1. 2. Metadata Management: If you only want to clean up old snapshots or orphan files without dropping the entire table, StarRocks also provides specific procedures: * `expire_snapshots`: To delete data files of expired snapshots. * `remove_orphan_files`: To delete files no longer referenced by any snapshot. If you are coming from a Hive background where
PURGE
is used, in StarRocks the equivalent for immediate/permanent deletion is always
FORCE
. References • data_source/catalog/iceberg/DDL.md • faq/Others.md • data_source/catalog/unified_catalog.md • data_source/catalog/iceberg/DML.md • data_source/External_table.md • data_source/catalog/iceberg/iceberg_catalog.md • data_source/catalog/iceberg/procedures.md