Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Note
This information applies to Databricks CLI versions 0.205 and above. The Databricks CLI is in Public Preview.
Databricks CLI use is subject to the Databricks License and Databricks Privacy Notice, including any Usage Data provisions.
The catalogs
command group within the Databricks CLI allows you to manage catalogs in Unity Catalog. A catalog is the first layer of Unity Catalog's three-level namespace. It's used to organize your data assets. See What is Unity Catalog?.
databricks catalogs create
Create a new catalog instance in the parent metastore if the caller is a metastore admin or has the CREATE_CATALOG
privilege.
databricks catalogs create NAME [flags]
Arguments
NAME
Name of catalog
Options
--comment string
User-provided free-form text description
--connection-name string
The name of the connection to an external data source
--json JSON
The inline JSON string or the @path to the JSON file with the request body
--provider-name string
The name of delta sharing provider
--share-name string
The name of the share under the share provider
--storage-root string
Storage root URL for managed tables within catalog
Examples
The following example creates a catalog named sales
:
databricks catalogs create sales
The following example creates a catalog with a comment:
databricks catalogs create sales --comment "Sales data catalog"
databricks catalogs delete
Delete the catalog that matches the supplied name. The caller must be a metastore admin or the owner of the catalog.
databricks catalogs delete NAME [flags]
Arguments
NAME
The name of the catalog
Options
--force
Force deletion even if the catalog is not empty
Examples
The following example deletes a catalog named sales
:
databricks catalogs delete sales
The following example forces deletion of a non-empty catalog:
databricks catalogs delete sales --force
databricks catalogs get
Get the specified catalog in a metastore. The caller must be a metastore admin, the owner of the catalog, or a user that has the USE_CATALOG
privilege set for their account.
databricks catalogs get NAME [flags]
Arguments
NAME
The name of the catalog
Options
--include-browse
Whether to include catalogs in the response for which the principal can only access selective metadata for
Examples
The following example gets information about a catalog named sales
:
databricks catalogs get sales
The following example gets catalog information including browse-only catalogs:
databricks catalogs get sales --include-browse
databricks catalogs list
List catalogs in the metastore. If the caller is the metastore admin, all catalogs will be retrieved. Otherwise, only catalogs owned by the caller (or for which the caller has the USE_CATALOG
privilege) will be retrieved. There is no guarantee of a specific ordering of the elements in the array.
databricks catalogs list [flags]
Options
--include-browse
Whether to include catalogs in the response for which the principal can only access selective metadata for
--max-results int
Maximum number of catalogs to return
--page-token string
Opaque pagination token to go to next page based on previous query
Examples
The following example lists all catalogs:
databricks catalogs list
The following example lists catalogs with a maximum of 10 results:
databricks catalogs list --max-results 10
The following example lists catalogs including browse-only catalogs:
databricks catalogs list --include-browse
databricks catalogs update
Update the catalog that matches the supplied name. The caller must be either the owner of the catalog, or a metastore admin (when changing the owner field of the catalog).
databricks catalogs update NAME [flags]
Arguments
NAME
The name of the catalog
Options
--comment string
User-provided free-form text description
--enable-predictive-optimization EnablePredictiveOptimization
Whether predictive optimization should be enabled for this object and objects under it. Supported values: DISABLE
, ENABLE
, INHERIT
--isolation-mode CatalogIsolationMode
Whether the current securable is accessible from all workspaces or a specific set of workspaces. Supported values: ISOLATED
, OPEN
--json JSON
The inline JSON string or the @path to the JSON file with the request body
--new-name string
New name for the catalog
--owner string
Username of current owner of catalog
Examples
The following example updates a catalog's comment:
databricks catalogs update sales --comment "Updated sales data catalog"
The following example renames a catalog:
databricks catalogs update sales --new-name sales-prod
The following example changes the owner of a catalog:
databricks catalogs update sales --owner someone@example.com
The following example enables predictive optimization for a catalog:
databricks catalogs update sales --enable-predictive-optimization ENABLE
Global flags
--debug
Whether to enable debug logging.
-h
or --help
Display help for the Databricks CLI or the related command group or the related command.
--log-file
string
A string representing the file to write output logs to. If this flag is not specified then the default is to write output logs to stderr.
--log-format
format
The log format type, text
or json
. The default value is text
.
--log-level
string
A string representing the log format level. If not specified then the log format level is disabled.
-o, --output
type
The command output type, text
or json
. The default value is text
.
-p, --profile
string
The name of the profile in the ~/.databrickscfg
file to use to run the command. If this flag is not specified then if it exists, the profile named DEFAULT
is used.
--progress-format
format
The format to display progress logs: default
, append
, inplace
, or json
-t, --target
string
If applicable, the bundle target to use