DROP VOLUME

Deletes a Volume object in Lakehouse (including External Volume and Named Volume).

Syntax

DROP VOLUME [IF EXISTS] [schema_name.]<volume_name>;

Parameters

ParameterDescription
IF EXISTSIf the Volume does not exist, skip without error
schema_nameName of the owning schema; current schema is used if omitted
volume_nameName of the Volume to delete

Examples

  1. Delete an External Volume:
DROP VOLUME my_oss_vol;
  1. Use IF EXISTS to avoid errors:
DROP VOLUME IF EXISTS my_oss_vol;
  1. 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

PrivilegeDescription
DROP VOLUMEDelete the specified Volume object