CREATE VOLUME

Creates a Named Volume using Lakehouse internal storage. Named Volumes must be explicitly created by users and are suitable for scenarios such as cross-team resource sharing.

Syntax

CREATE VOLUME [IF NOT EXISTS] [schema_name.]<volume_name>
    DIRECTORY = (
        enable = { true | false },
        auto_refresh = { true | false }
    )
    RECURSIVE = { true | false };

Parameters

ParameterDescription
IF NOT EXISTSIf the Volume already exists, skip without error
schema_nameName of the owning schema; current schema is used if omitted
volume_nameVolume name, must be unique within the same schema
DIRECTORY.enableWhether to enable the directory feature; recommended to set to true
DIRECTORY.auto_refreshWhether to automatically refresh file metadata
RECURSIVEWhether to recursively scan subdirectories

Examples

  1. Create a Named Volume using internal storage:
CREATE VOLUME my_named_vol
    DIRECTORY = (enable = true, auto_refresh = true)
    RECURSIVE = true;
  1. Create a Named Volume under a specific schema:
CREATE VOLUME IF NOT EXISTS my_schema.shared_vol
    DIRECTORY = (enable = true, auto_refresh = true)
    RECURSIVE = true;

Notes

  • Named Volume storage costs are charged at the Lakehouse storage standard rate
  • Named Volumes do not support ALTER VOLUME ... REFRESH (only External Volumes support this)
  • Deleting a Named Volume does not delete the actual files in internal storage; to delete files, first use the REMOVE command

Required Privileges

PrivilegeDescription
CREATE VOLUMECreate a Volume under the current schema