CREATE SHARE

適用対象:check marked yes Databricks SQL check marked yes Databricks Runtime 10.3 以上 check marked yes Unity Catalog のみ

指定した名前の共有を作成します。 同じ名前の共有が既に存在する場合は、例外がスローされます。

共有を作成するには、共有するデータが登録されている Unity Catalog メタストアのメタストア管理者であるか、CREATE SHARE 特権を持っている必要があります。

共有にコンテンツを追加するには、ALTER SHARE を使用します。

構文

CREATE SHARE [ IF NOT EXISTS ] share_name
    [ COMMENT comment ]

パラメーター

  • share_name

    作成する共有の名前。

  • IF NOT EXISTS

    指定した名前の共有が存在しない場合は作成します。 同じ名前の共有が既に存在する場合は、何も行いません。

  • comment

    STRING リテラル (省略可能)。 共有の説明。

-- Create share `customer_share`. This throws exception if a share with name customer_share
-- already exists.
> CREATE SHARE customer_share;

-- Create share `customer_share` only if share with same name doesn't exist.
> CREATE SHARE IF NOT EXISTS customer_share;

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