DROP VOLUME
Deletes a Volume object in Lakehouse (including External Volume and Named Volume).
Syntax
DROP VOLUME [IF EXISTS] [schema_name.]<volume_name>;
Parameters
| Parameter | Description |
|---|
IF EXISTS | If the Volume does not exist, skip without error |
schema_name | Name of the owning schema; current schema is used if omitted |
volume_name | Name of the Volume to delete |
Examples
- Delete an External Volume:
- Use
IF EXISTS to avoid errors:
DROP VOLUME IF EXISTS my_oss_vol;
- Delete a Volume under a specific schema:
DROP VOLUME IF EXISTS my_schema.my_named_vol;
Notes
- Deleting an External Volume only removes the metadata reference in Lakehouse and does not delete the actual files in the external object storage
- Deleting a Named Volume only removes the metadata reference in Lakehouse and does not delete the actual files in internal storage; to delete files, first use the
REMOVE command
- The delete operation is irreversible; confirm that the Volume is no longer in use before executing
Required Privileges
| Privilege | Description |
|---|
DROP VOLUME | Delete the specified Volume object |