Reference and syntax for the CREATE LOCATION statement.
LOCATION
to centralize credential storage with managed access with Role-Based Access Control (RBAC) for CREATE
, MODIFY
, and USAGE
permissions for different users, use a single location definition for multiple tables and queries, and control access to sensitive data. LOCATION
is version control-friendly because no sensitive credentials are stored in source code.
After you create a LOCATION
, you can use the information_schema.locations
view to see details about all the locations in your account including source type, URL, description, owner and creation time.
For a comprehensive guide to understanding and using LOCATION objects, see LOCATION objects.
Related:
This document covers LOCATION
objects in general. For more information about specific types of LOCATION
objects, including more in-depth examples, please see:
Topics:
Parameter | Description |
---|---|
<location_name> | A unique identifier for the location within your account. |
SOURCE | The external data source type. Currently, AMAZON_S3 (See CREATE LOCATION (Amazon S3)) and ICEBERG (See CREATE LOCATION (Iceberg)) are supported. |
DESCRIPTION | Optional metadata describing the location’s purpose. |
Parameter | Description |
---|---|
CREDENTIALS | Authentication credentials for Amazon S3 access. |
URL | The data source URL in the format: s3://{bucket_name}/{path} . This must be a valid S3 URL. |
Parameter | Description |
---|---|
CATALOG | The type of Iceberg catalog. Supported values: FILE_BASED , REST , or DATABRICKS_UNITY . |
CATALOG_OPTIONS | Configuration options specific to the chosen catalog type. |
CREDENTIALS | Authentication credentials for accessing the Iceberg catalog. Depending on the type of catalog, either AWS or OAuth credentials are used. |
Parameter | Description |
---|---|
AWS_ACCESS_KEY_ID | Your AWS access key ID for key-based authentication. |
AWS_SECRET_ACCESS_KEY | Your AWS secret access key for key-based authentication. |
AWS_SESSION_TOKEN | Optional temporary session token for temporary credentials. |
AWS_ROLE_ARN | The ARN of the IAM role to assume for role-based authentication. |
AWS_ROLE_EXTERNAL_ID | Optional external ID for role assumption. |
Parameter | Description |
---|---|
OAUTH_CLIENT_ID | The OAuth client ID for authentication. |
OAUTH_CLIENT_SECRET | The OAuth client secret for authentication. |
OAUTH_SCOPE | Optional OAuth scope for authentication. |
OAUTH_SERVER_URL | Optional OAuth server URL for authentication. |
Parameter | Description |
---|---|
URL | The URL for the file-based catalog. |
Parameter | Description |
---|---|
URL | The REST catalog URL. |
WAREHOUSE | The warehouse identifier. |
NAMESPACE | The namespace identifier. |
TABLE | The table name. |
Parameter | Description |
---|---|
WORKSPACE_INSTANCE | The Databricks workspace instance. |
CATALOG | The Unity Catalog name. |
SCHEMA | The Unity Catalog schema name. |
TABLE | The Unity Catalog table name. |
my_location
, for an Amazon S3 data source with the specified URL and description:
my_ext_table
that uses a previously created location my_location
to load Parquet data files matching the *.parquet pattern from Amazon S3:
COPY FROM
to load Parquet data files matching the *.parquet pattern from my_location
into my_table
:
LOCATION
to load data with a TVFLOCATION
to load data using table-valued functions (TVFs) such as READ_CSV, READ_PARQUET, and LIST_OBJECTS.
The following code example uses READ_CSV
to query data from a CSV file stored in my_location
, using the first row as headers for column names:
LOCATION
from your Firbolt account:
LOCATION
that you are dropping.DROP CASCADE
functionality is not supported.