CREATE VOLUME
적용 대상: Databricks SQL
Databricks Runtime 13.3 LTS 이상
Unity 카탈로그 전용
지정된 이름의 볼륨을 만듭니다. 이름이 같은 볼륨이 스키마에 이미 있는 경우 VOLUME_ALREADY_EXISTS 발생합니다.
볼륨 사용에 대한 자세한 내용은 볼륨 참조하세요.
구문
CREATE [ EXTERNAL ] VOLUME [ IF NOT EXISTS ] volume_name
[ LOCATION location_path ]
[ COMMENT comment ]
매개 변수
외부
IF NOT EXISTS
지정된 이름의 볼륨이 없으면 볼륨을 만듭니다. 이름이 같은 볼륨이 이미 있는 경우 아무 작업도 수행되지 않습니다.
-
만들 볼륨의 이름입니다. 볼륨은 Unity 카탈로그 스키마에서만 만들 수 있습니다.
LOCATION
location_path
location_path
STRING
는 지정된 외부 볼륨이 만들어지는 파일 시스템의 경로를 정의하는 리터럴입니다. 지정된 경로가 기본 파일 시스템에 존재하지 않는 경우 해당 경로가 있는 디렉터리를 만듭니다. 선택한 경로는 다른 볼륨 또는 테이블의 위치와 겹치지 않아야 합니다.이 조항은
관리되는 볼륨에는 적용되지 않습니다. comment
볼륨에 대한 선택적
STRING
리터럴 설명입니다.
예제
-- Create an external volume on the specified location with comment
> CREATE EXTERNAL VOLUME my_catalog.my_schema.my_external_volume
LOCATION 's3://my-bucket/my-location/my-path'
COMMENT 'This is my example external volume on S3'
OK
-- Query the data from the file in the created volume
> SELECT *
FROM csv.`/Volumes/my_catalog/my_schema/my_external_volume/foo.csv`
-- Create a managed volume with full schema name
> CREATE VOLUME my_catalog.my_schema.my_volume
OK
-- Create a managed volume in default catalog and schema
> CREATE VOLUME my_another_volume
OK