CREATE CATALOG

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 10.3 and above

Creates a catalog with the specified name. If a catalog with the same name already exists, an exception is thrown.

Syntax

CREATE CATALOG [ IF NOT EXISTS ] catalog_name
    [ USING SHARE provider_name . share_name ]
    [ COMMENT comment ]

Parameters

  • IF NOT EXISTS

    Creates a catalog with the given name if it does not exist. If a catalog with the same name already exists, nothing will happen.

  • catalog_name

    The name of the catalog to be created.

  • USING SHARE provider_name . share_name

    Optionally specifies that the catalog is based on a Delta Sharing share.

  • comment

    An optional STRING literal. The description for the catalog.

Examples

-- Create catalog `customer_cat`. This throws exception if catalog with name customer_cat
-- already exists.
> CREATE CATALOG customer_cat;

-- Create catalog `customer_cat` only if catalog with same name doesn't exist.
> CREATE CATALOG IF NOT EXISTS customer_cat;

-- Create catalog `customer_cat` only if catalog with same name doesn't exist, with a comment.
> CREATE CATALOG IF NOT EXISTS customer_cat COMMENT 'This is customer catalog';

-- Create a cataog from a Delta Sharing share.
> CREATE CATALOG customer_cat USING SHARE cdc.vaccinedata;