Creates a new volume.
The user could create either an external volume or a managed volume. An external volume will be created in the specified external location, while a managed volume will be located in the default location which is specified bythe parent schema, or the parent catalog, or the Metastore.
For the volume creation to succeed, the user must satisfy following conditions: - The caller must be a metastore admin, or be the owner of th parent catalog and schema, or have the **USE_CATALOG** privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema. - The caller must have **CREATE VOLUME** privilege on the parent schema.
For an external volume, following conditions also need to satisfy - The caller must have **CREATE EXTERNAL VOLUME** privilege on the external location. -There are no other tables, nor volumes existing in the specified storagelocation. - The specified storage location is not under the location of other tables, nor volumes, or catalogs or schemas.
Usage:
databricks volumes create CATALOG_NAME SCHEMA_NAME NAME VOLUME_TYPE
As for creating DBFS directories and subdirectories, you can use the dbfs
CLI command. Here's an example of creating the directories Test
and Test1
:
bash
databricks fs mkdirs dbfs:/FileStore/Test/Test1/
This command creates both the Test
and Test1
directories if they do not already exist.