CREATE RECIPIENT (Databricks SQL)

Preview

Delta Sharing is in Public Preview. To participate in the preview, you must enable the External Data Sharing feature group in the Databricks Account Console. See Enable the External Data Sharing feature group for your account.

Delta Sharing is subject to applicable terms. Enabling the External Data Sharing feature group represents acceptance of those terms.

Creates a recipient with the specified name and generates an activation link. If a recipient with the same name already exists, an exception is thrown.

To create and manage a recipient you must be a metastore administrator and Databricks SQL must be configured with the Unity Catalog metastore.

Use DESCRIBE RECIPIENT to retrieve the activation link.

Syntax

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

Parameters

  • recipient_name

    The name of the recipient to be created.

  • IF NOT EXISTS

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

  • comment

    An optional STRING literal. The description for the recipient.

Examples

-- 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