CREATE RECIPIENT

重要

Delta Sharing 目前为公共预览版。 要使用预览版,必须在 Azure Databricks 帐户控制台中启用外部数据共享功能组。 请参阅为帐户启用外部数据共享功能组

Delta Sharing 受适用条款约束。 启用外部数据共享功能组即表示接受这些条款。

创建具有指定名称的收件人并生成激活链接。 如果已存在同名收件人,则会引发异常。

要创建和管理收件人,你必须是元存储管理员,并且必须使用 Unity Catalog 元存储配置 Databricks Runtime。

使用 DESCRIBE RECIPIENT 检索激活链接。

起始版本:Databricks Runtime 10.3

语法

CREATE RECPIENT [ IF NOT EXISTS ] recipient_name
    [ COMMENT comment ]

参数

  • recipient_name

    要创建的收件人的名称。

  • IF NOT EXISTS

    创建具有给定名称的收件人(如果不存在)。 如果已存在同名收件人,则不会执行任何操作。

  • comment

    可选的 STRING 文本。 收件人的说明。

示例

-- Create recipient `other_corp` This throws an exception if a recipient with name other_corp
-- already exists.
> CREATE RECIPIENT other_corp;

-- Create recipient `other_corp` only if a recipient with the same name doesn't exist.
> CREATE RECIPIENT IF NOT EXISTS other_corp;

-- Create recipient `other_corp` only if a recipient with same name doesn't exist, with a comment.
> CREATE RECIPIENT IF NOT EXISTS other_corp COMMENT 'This is Other Corp';

-- Retrieve the activation link
> DESCRIBE RECIPIENT other_corp;
  name       created_at                   created_by                 comment            activation_link   active_token_id                      active_token_expiration_time rotated_token_id rotated_token_expiration_time
  ---------- ---------------------------- -------------------------- ------------------ ----------------- ------------------------------------ ---------------------------- ---------------- -----------------------------
  other_corp 2022-01-01T00:00:00.000+0000 alwaysworks@databricks.com This is Other Corp https://send/this 0160c81f-5262-40bb-9b03-3ee12e6d98d7 9999-12-31T23:59:59.999+0000 NULL             NULL