---
title: Create shares for OpenSharing
description: Create OpenSharing shares in Databricks to securely share tables, streaming tables, views, materialized views, metric views, volumes, agent skills, models, and notebooks with recipients inside or outside your organization.
canonical_url: https://docs.databricks.com/gcp/en/opensharing/create-share
---

# Create shares for OpenSharing

A share is a securable object in Unity Catalog that represents a collection of data and AI assets you want to share with one or more recipients. Create a share, add assets to it, and grant recipients access.

A share can contain the following data assets:

* [Tables and table partitions](https://docs.databricks.com/gcp/en/opensharing/create-share.md#add-tables)
* [Streaming tables](https://docs.databricks.com/gcp/en/opensharing/create-share.md#streaming-tables)
* [Managed Iceberg tables](https://docs.databricks.com/gcp/en/opensharing/create-share.md#managed-iceberg)
* [Foreign Iceberg tables](https://docs.databricks.com/gcp/en/opensharing/create-share.md#foreign-iceberg)
* [Foreign Delta tables](https://docs.databricks.com/gcp/en/opensharing/create-share.md#foreign-delta)
* [Foreign schemas and tables](https://docs.databricks.com/gcp/en/opensharing/create-share.md#foreign-asset)
* [Views](https://docs.databricks.com/gcp/en/opensharing/create-share.md#views), including [dynamic views](https://docs.databricks.com/gcp/en/opensharing/create-share.md#dynamic-views) that restrict access at the row and column level
* [Materialized views](https://docs.databricks.com/gcp/en/opensharing/create-share.md#materialized-views)
* [Metric views](https://docs.databricks.com/gcp/en/opensharing/create-share.md#metric-views)
* [Volumes](https://docs.databricks.com/gcp/en/opensharing/create-share.md#volumes)
* [Agent skills](https://docs.databricks.com/gcp/en/opensharing/create-share.md#skills)
* [Python UDFs](https://docs.databricks.com/gcp/en/opensharing/create-share.md#python-udfs)
* [Notebooks](https://docs.databricks.com/gcp/en/opensharing/create-share.md#add-remove-notebook-files)
* [AI models](https://docs.databricks.com/gcp/en/opensharing/create-share.md#models)
* [Genie Agents](https://docs.databricks.com/gcp/en/opensharing/share-genie-agent.md)

If you share an entire schema (database), the recipient can access all of the tables, streaming tables, views, materialized views, models, volumes, and agent skills in the schema at the moment you share it, along with any data and AI assets added to the schema in the future.

A share can contain data and AI assets from only one Unity Catalog metastore. You can add or remove data and AI assets from a share at any time.

Before creating a share, verify that you have [Set up OpenSharing for your account (for providers)](https://docs.databricks.com/gcp/en/opensharing/set-up.md).

To learn more about the sharing model, see [Shares, providers, and recipients](https://docs.databricks.com/gcp/en/opensharing/index.md#shares-recipients).

## <a id="requirements" />Requirements

Check that you meet the listed requirements for each task you want to complete.

> [!TIP]
>
> When adding data assets to a share, Databricks recommends that you use a group as the share owner.

| Task                                                                                                                                                                                                                                                                 | Requirements                                                                                                                                                                                                                                                                                                                                                                                                           |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Create a share                                                                                                                                                                                                                                                       | <ul><li>Have the `CREATE SHARE` privilege for the Unity Catalog metastore where the data you want to share is registered.</li><li>Create the share using a Databricks workspace that has that Unity Catalog metastore attached.</li></ul>                                                                                                                                                                              |
| Add the following to a share:<br /><ul><li>Tables</li><li>Streaming tables</li><li>Managed Iceberg tables</li><li>Foreign tables</li><li>Foreign Iceberg tables</li><li>Foreign Delta tables</li><li>Views</li><li>Materialized views</li><li>Metric views</li></ul> | <ul><li>Be the share owner.</li><li>Have the `USE CATALOG` and `USE SCHEMA` privilege on the catalog and schema that contain the data asset.</li><li>Have the `SELECT` privilege on the data asset. You must keep that privilege in order for the asset to continue to be shared. If you lose it, the recipient cannot access the asset through the share.</li></ul>                                                   |
| Share an entire schema or foreign schema                                                                                                                                                                                                                             | <ul><li>Be the share owner and the schema owner, or have `USE SCHEMA`.</li><li>Have `SELECT` on the schema to share tables.</li><li>Have `READ VOLUME` on the schema to share volumes.</li></ul>                                                                                                                                                                                                                       |
| Add volumes to a share                                                                                                                                                                                                                                               | <ul><li>Be the share owner.</li><li>Have the `USE CATALOG` and `USE SCHEMA` privilege on the catalog and schema that contain the volume, or ownership of the catalog or schema.</li><li>Have the `READ VOLUME` privilege on the volume. You must keep that privilege in order for the volume to continue to be shared. If you lose it, the recipient cannot access the volume through the share.</li></ul>             |
| Add agent skills to a share                                                                                                                                                                                                                                          | <ul><li>Be the share owner.</li><li>Have the `USE CATALOG` and `USE SCHEMA` privilege on the catalog and schema that contain the agent skill, or ownership of the catalog or schema.</li><li>Have the `READ VOLUME` privilege on the agent skill. You must keep that privilege in order for the skill to continue to be shared. If you lose it, the recipient cannot access the skill through the share.</li></ul>     |
| Add Python UDFs to a share                                                                                                                                                                                                                                           | <ul><li>Be the share owner.</li><li>Have the `USE CATALOG` and `USE SCHEMA` privilege on the catalog and schema that contain the Python UDF, or ownership of the catalog or schema.</li><li>Have the `EXECUTE` privilege on the Python UDF. You must keep that privilege in order for the Python UDF to continue to be shared. If you lose it, the recipient cannot access the Python UDF through the share.</li></ul> |
| Add models to a share                                                                                                                                                                                                                                                | <ul><li>Be the share owner.</li><li>Have the `USE CATALOG` and `USE SCHEMA` privilege on the catalog and schema that contain the model, or ownership of the catalog or schema.</li><li>Have the `EXECUTE` privilege on the model. You must keep that privilege in order for the model to continue to be shared. If you lose it, the recipient cannot access the model through the share.</li></ul>                     |
| Add notebook files to a share                                                                                                                                                                                                                                        | <ul><li>Be the share owner, with CAN READ permission on the notebook.</li></ul>                                                                                                                                                                                                                                                                                                                                        |

### Compute requirements

* If you use a Databricks notebook to create the share, your compute resource must use Databricks Runtime 11.3 LTS or above and have a standard or dedicated access mode (formerly shared and single user).
* If you use SQL statements to add a schema to a share (or update or remove a schema), you must use a SQL warehouse or compute running Databricks Runtime 13.3 LTS or above. Doing the same using Catalog Explorer has no compute requirements.

## Create a share object

Check that you meet the [requirements](https://docs.databricks.com/gcp/en/opensharing/create-share.md#requirements) before creating a share object.

To create a share, use Catalog Explorer, the Databricks Unity Catalog CLI, or the `CREATE SHARE` SQL command in a Databricks notebook or the Databricks SQL query editor.

### Catalog Explorer

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/gcp/en/images/product-icons/DataIcon.svg) **Catalog**.

2. At the top of the **Catalog** pane, click the ![Gear icon.](https://docs.databricks.com/gcp/en/images/product-icons/GearIcon.svg) gear icon and select **OpenSharing**.

   Alternatively, in the upper-right corner, click **Share > OpenSharing**.

3. On the **Shared by me** tab, click the **Share data** button.

4. On the **Create share** page, enter the share **Name** and an optional comment.

5. Click **Save and continue**.

   You can continue to add data assets, or you can stop and come back later.

6. On the **Add data assets** tab, select the data assets you want to share.

   For detailed instructions, additional requirements, and related limitations, see:

   * [Add tables to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#add-tables)
   * [Add streaming tables to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#streaming-tables)
   * [Add managed Iceberg tables to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#managed-iceberg)
   * [Add foreign schemas or tables to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#foreign-asset)
   * [Add volumes to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#volumes)
   * [Add views to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#views)
   * [Add materialized views to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#materialized-views)
   * [Add metric views to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#metric-views)
   * [Add models to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#models)

7. Click **Save and continue**.

8. On the **Add notebooks** tab, select the notebooks you want to share.

   For detailed instructions, see [Add notebook files to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#add-remove-notebook-files).

9. Click **Save and continue**.

10. On the **Add recipients** tab, select the recipients you want to share with.

    For detailed instructions, see [Manage access to OpenSharing data shares (for providers)](https://docs.databricks.com/gcp/en/opensharing/grant-access.md).

11. Click **Share data** to share the data with the recipients.

    If you have not created recipients yet, click **Share data**, create recipients, and grant them access later.

### SQL

Run the following command in a notebook or the Databricks SQL query editor:

```sql
CREATE SHARE [IF NOT EXISTS] <share-name>
[COMMENT "<comment>"];
```

Now you can add tables, streaming tables, volumes, views, materialized views, and models to the share.

For detailed instructions, additional requirements, and related limitations, see:

* [Add tables to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#add-tables)
* [Add streaming tables to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#streaming-tables)
* [Add managed Iceberg tables to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#managed-iceberg)
* [Add foreign schemas or tables to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#foreign-asset)
* [Add volumes to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#volumes)
* [Add views to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#views)
* [Add materialized views to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#materialized-views)
* [Add metric views to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#metric-views)
* [Add models to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#models)

### CLI

Run the following command using the [Databricks CLI](https://docs.databricks.com/gcp/en/dev-tools/cli/index.md).

```bash
databricks shares create <share-name>
```

You can use `--comment` to add a comment or `--json` to add assets to the share. For details, see the sections that follow.

Now you can add tables, streaming tables, volumes, views, materialized views, and models to the share.

For detailed instructions, additional requirements, and related limitations, see:

* [Add tables to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#add-tables)
* [Add streaming tables to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#streaming-tables)
* [Add managed Iceberg tables to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#managed-iceberg)
* [Add foreign schemas or tables to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#foreign-asset)
* [Add volumes to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#volumes)
* [Add views to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#views)
* [Add materialized views to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#materialized-views)
* [Add metric views to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#metric-views)
* [Add models to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#models)

## <a id="add-tables" />Add tables to a share

Check that you meet the [requirements](https://docs.databricks.com/gcp/en/opensharing/create-share.md#requirements) before adding tables to a share. Some tables can't be shared. See [Unsupported tables](https://docs.databricks.com/gcp/en/opensharing/index.md#unsupported-tables).

If you are a workspace admin and you inherited the `USE SCHEMA` and `USE CATALOG` permissions on the schema and catalog that contain the table from the workspace admin group, then you cannot add the table to a share. You must first grant yourself the `USE SCHEMA` and `USE CATALOG` permissions on the schema and catalog.

> [!NOTE]
>
> Table comments, column comments, and [primary key constraints](https://docs.databricks.com/gcp/en/tables/constraints.md) are included in shares that are shared with a recipient using Databricks-to-Databricks sharing on or after July 25, 2024. If you want to start sharing comments and constraints through a share that was shared with a recipient before the release date, you must revoke and re-grant recipient access to trigger comment and constraint sharing.

To add tables to a share, use Catalog Explorer, the Databricks Unity Catalog CLI, or SQL commands in a Databricks notebook or the Databricks SQL query editor.

### Catalog Explorer

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/gcp/en/images/product-icons/DataIcon.svg) **Catalog**.

2. At the top of the **Catalog** pane, click the ![Gear icon.](https://docs.databricks.com/gcp/en/images/product-icons/GearIcon.svg) gear icon and select **OpenSharing**.

   Alternatively, in the upper-right corner, click **Share > OpenSharing**.

3. On the **Shared by me** tab, find the share you want to add a table to and click its name.
   You can add tables with [row tracking](https://docs.databricks.com/gcp/en/tables/features/row-tracking.md) enabled. Recipients can query the row tracking columns.

4. Click **Manage assets > Edit assets**.

5. On the **Edit assets** page, select either an entire schema (database) or individual tables.
   * To select a table, first select the catalog, then the schema that contains the table, then the table itself.

     You can search for tables by name, column name, or comment using workspace search. See [Search for workspace objects](https://docs.databricks.com/gcp/en/search/index.md).

   * To select a schema, first select the catalog and then the schema.

     For detailed information about sharing schemas, see [Add schemas to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#schemas).

6. **History**: Share the table history to allow recipients to perform time travel queries, read the table with Spark Structured Streaming, or run [transactions](https://docs.databricks.com/gcp/en/transactions/index.md). For Databricks-to-Databricks shares, the table's Delta log is also shared to improve performance. See [Improve table read performance with history sharing](https://docs.databricks.com/gcp/en/opensharing/share-data-databricks.md#share-history). History sharing requires Databricks Runtime 12.2 LTS or above.

   > [!NOTE]
   >
   > If you also want your customers to be able to query a table's change data feed (CDF) using the [table\_changes() function](https://docs.databricks.com/gcp/en/sql/language-manual/functions/table_changes.md), you must [enable CDF on the table](https://docs.databricks.com/gcp/en/tables/features/change-data-feed.md#enable) before you share it `WITH HISTORY`.

7. (Optional) Click ![Speech bubble plus icon.](https://docs.databricks.com/gcp/en/images/product-icons/SpeechBubblePlusIcon.svg) under the **Alias** or **Partition** columns to add an alias or partition. Alias and partitions are not available if you select an entire schema. Table history is included by default if you select an entire schema.
   * **Alias**: An alternate table name to make the table name more readable. The alias is the table name that the recipient sees and must use in queries. Recipients cannot use the actual table name if an alias is specified.
   * **Partition**: Share only part of the table. For example, `(column = 'value')`. See [Specify table partitions to share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#partitions) and [Use recipient properties to do partition filtering](https://docs.databricks.com/gcp/en/opensharing/create-share.md#properties).

8. Click **Save**.

### SQL

Run the following command in a notebook or the Databricks SQL query editor to add a table:

```sql
ALTER SHARE <share-name> ADD TABLE <catalog-name>.<schema-name>.<table-name>  [COMMENT "<comment>"]
   [PARTITION(<clause>)] [AS <alias>]
   [WITH HISTORY | WITHOUT HISTORY];
```

Run the following to add an entire schema. The `ADD SCHEMA` command requires a SQL warehouse or compute running Databricks Runtime 13.3 LTS or above. For detailed information about sharing schemas, see [Add schemas to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#schemas).

```sql
ALTER SHARE <share-name> ADD SCHEMA <catalog-name>.<schema-name>
[COMMENT "<comment>"];
```

Options include the following. `PARTITION` and `AS <alias>` are not available if you select an entire schema.

* `PARTITION(<clause>)`: If you want to share only part of the table, you can specify a partition. For example, `(column = 'value')` See [Specify table partitions to share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#partitions) and [Use recipient properties to do partition filtering](https://docs.databricks.com/gcp/en/opensharing/create-share.md#properties).
* `AS <alias>`: An alternate table name, or **Alias** to make the table name more readable. The alias is the table name that the recipient sees and must use in queries. Recipients cannot use the actual table name if an alias is specified. Use the format `<schema-name>.<table-name>`.
* `WITH HISTORY` or `WITHOUT HISTORY`: When `WITH HISTORY` is specified, share the table with full history, allowing recipients to perform time travel queries, streaming reads, and run [transactions](https://docs.databricks.com/gcp/en/transactions/index.md). For Databricks-to-Databricks shares, history sharing also shares the table's Delta log to improve performance. The default behavior for table sharing is `WITH HISTORY` if your compute is running Databricks Runtime 16.2 or above and `WITHOUT HISTORY` for earlier Databricks Runtime versions. For schema sharing, the default is `WITH HISTORY` regardless of Databricks Runtime version. `WITH HISTORY` and `WITHOUT HISTORY` require Databricks Runtime 12.2 LTS or above. See also [Improve table read performance with history sharing](https://docs.databricks.com/gcp/en/opensharing/share-data-databricks.md#share-history).

  > [!NOTE]
  >
  > If, in addition to doing time travel queries and streaming reads, you want your recipients to query a table's change data feed (CDF) using the [table\_changes() function](https://docs.databricks.com/gcp/en/sql/language-manual/functions/table_changes.md), you must [enable CDF on the table](https://docs.databricks.com/gcp/en/tables/features/change-data-feed.md#enable) before you share it `WITH HISTORY`.

For more information about `ALTER SHARE` options, see [ALTER SHARE](https://docs.databricks.com/gcp/en/sql/language-manual/sql-ref-syntax-ddl-alter-share.md).

### CLI

To add a table, run the following command using the [Databricks CLI](https://docs.databricks.com/gcp/en/dev-tools/cli/index.md).

```bash
databricks shares update <share-name> \
  --json '{
    "updates": [
      {
        "action": "ADD",
        "data_object": {
          "name": "<table-full-name>",
          "data_object_type": "TABLE",
          "shared_as": "<table-alias>"
        }
      }
    ]
  }'
```

To add a schema, run the following Databricks CLI command:

```bash
databricks shares update <share-name> \
  --json '{
    "updates": [
      {
        "action": "ADD",
        "data_object": {
          "name": "<schema-full-name>",
          "data_object_type": "SCHEMA"
        }
      }
    ]
  }'
```

> [!NOTE]
>
> For tables, and only tables, you can omit `"data_object_type"`.

To learn about the options listed in this example, view the instructions on the SQL tab.

To learn about additional parameters, run `databricks shares update --help` or see [PATCH /api/2.1/unity-catalog/shares/](https://docs.databricks.com/api/workspace/shares/update) in the REST API reference.

For information about removing tables from a share, see [Update shares](https://docs.databricks.com/gcp/en/opensharing/manage-share.md#update).

### <a id="cloud-token-eligibility" />Cloud token eligibility

Databricks uses cloud tokens (temporary, path-scoped cloud credentials) to give recipients direct read access to shared Delta table files. In the Databricks-to-Open sharing protocol, this is also called *directory-based access mode*. Views, materialized views, foreign tables (except foreign Delta and foreign Iceberg tables), streaming tables, volumes, notebooks, Python UDFs, and AI models are not supported. Which tables qualify depends on the sharing protocol.

**Databricks-to-Databricks sharing**: Cloud tokens are used when all of the following are true:

* The table is shared `WITH HISTORY` (full history from the beginning).
* The table is shared without a partition filter.

**Databricks-to-Open sharing**: Cloud tokens (directory-based access mode) are used when all of the following are true:

* The shared object is a *managed or external Delta table*.
* The table is shared `WITH HISTORY` (full history from the beginning).
* The table is shared without a partition filter.
* The table is not a CCv2 table.
* The table does not use default storage.

For Databricks-to-Databricks shares, cloud tokens are exchanged directly between Unity Catalog metastores without long-lived bearer tokens, resulting in performance comparable to direct source table access. For Databricks-to-Open sharing, the OpenSharing server includes the table's cloud storage location and `accessModes: ["url", "dir"]` in list and metadata responses. Open recipients can call the [Generate Temporary Table Credentials](https://github.com/delta-io/delta-sharing/blob/main/PROTOCOL.md#generate-temporary-table-credential) endpoint to obtain credentials and read directly from cloud storage.

> [!IMPORTANT]
>
> When cloud token access is used, recipients receive credentials scoped to the root directory of the shared Delta table. This grants read access to both the data files and the Delta log. The Delta log contains the commit history for each table version, information about the committer, and deleted data that has not been vacuumed.

<a id="presigned-url-limitations" />Tables that aren't eligible for cloud tokens are shared using pre-signed URLs, also called *URL-based access mode* in the Databricks-to-Open sharing protocol. Recipients can't run the following commands on these tables:

* [DESCRIBE DETAIL](https://docs.databricks.com/gcp/en/sql/language-manual/sql-ref-syntax-aux-describe-table.md#describe-detail)
* [DESCRIBE HISTORY](https://docs.databricks.com/gcp/en/sql/language-manual/delta-describe-history.md)
* [DEEP CLONE](https://docs.databricks.com/gcp/en/sql/language-manual/delta-clone.md)

If recipients need to run these commands, make sure that the table meets the cloud token eligibility requirements for its sharing protocol.

Each pre-signed URL is valid for up to one hour. A URL expires sooner if the temporary cloud credential that Databricks used to sign it expires first. Query responses return each URL's actual expiration time, in epoch milliseconds, in the `expirationTimestamp` field of its file action.

## <a id="partitions" />Specify table partitions to share

To share only part of a table when you add the table to a share, provide a partition specification. Specify partitions when you add a table to a share or update a share, using Catalog Explorer, the Databricks Unity Catalog CLI, or SQL commands in a Databricks notebook or the Databricks SQL query editor. See [Add tables to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#add-tables) and [Update shares](https://docs.databricks.com/gcp/en/opensharing/manage-share.md#update).

### Example

The following SQL example shares part of the data in the `inventory` table, partitioned by the `year`, `month`, and `date` columns:

* Data for the year 2021.
* Data for December 2020.
* Data for December 25, 2019.

```sql
ALTER SHARE share_name
ADD TABLE inventory
PARTITION (year = "2021"),
          (year = "2020", month = "Dec"),
          (year = "2019", month = "Dec", date = "2019-12-25");
```

### <a id="properties" />Use recipient properties to do partition filtering

You can share a table partition that matches [data recipient properties](https://docs.databricks.com/gcp/en/opensharing/manage-recipients.md#properties), also known as parameterized partition sharing.

Default properties include:

* `databricks.accountId`: The Databricks account that a data recipient belongs to (Databricks-to-Databricks sharing only).
* `databricks.metastoreId`: The Unity Catalog metastore that a data recipient belongs to (Databricks-to-Databricks sharing only).
* `databricks.name`: The name of the data recipient.

You can create any custom property when you create or update a recipient.

Filtering by recipient property enables you to share the same tables, using the same share, across multiple Databricks accounts, workspaces, and users while maintaining data boundaries between them.

For example, if your tables include a Databricks account ID column, you can create a single share with table partitions defined by Databricks account ID. When you share, OpenSharing dynamically delivers to each recipient only the data associated with their Databricks account.

![Diagram of parameter-based dynamic partition sharing in OpenSharing](https://docs.databricks.com/gcp/en/images/opensharing/parameterized-partitions.png)

Without the ability to dynamically partition by property, you would have to create a separate share for each recipient.

To specify a partition that filters by recipient properties when you create or update a share, you can use Catalog Explorer or the `CURRENT_RECIPIENT` SQL function in a Databricks notebook or the Databricks SQL query editor:

> [!NOTE]
>
> Recipient properties are available on Databricks Runtime 12.2 or above.

#### Catalog Explorer

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/gcp/en/images/product-icons/DataIcon.svg) **Catalog**.

2. At the top of the **Catalog** pane, click the ![Gear icon.](https://docs.databricks.com/gcp/en/images/product-icons/GearIcon.svg) gear icon and select **OpenSharing**.

   Alternatively, in the upper-right corner, click **Share > OpenSharing**.

3. On the **Shared by me** tab, find the share you want to update and click its name.

4. Click **Manage assets > Add data assets**.

5. On the **Add tables** page, select the catalog and database that contain the table, then select the table.

   If you aren't sure which catalog and database contain the table, you can search for it by name, column name, or comment using workspace search. See [Search for workspace objects](https://docs.databricks.com/gcp/en/search/index.md).

6. (Optional) Click ![Speech bubble plus icon.](https://docs.databricks.com/gcp/en/images/product-icons/SpeechBubblePlusIcon.svg) under **Partition** column to add a partition.

   On the **Add partition to the table** dialog, add the property-based partition specification using the following syntax:

   ```
   (<column-name> = CURRENT_RECIPIENT().<property-key>)
   ```

   For example,

   ```
   (country = CURRENT_RECIPIENT().country)
   ```

7. Click **Save**.

#### SQL

Run the following command in a notebook or the Databricks SQL query editor:

```sql
ALTER SHARE <share-name> ADD TABLE <catalog-name>.<schema-name>.<table-name>
   PARTITION (<column-name> = CURRENT_RECIPIENT().<property-key>);
```

For example,

```sql
ALTER SHARE acme ADD TABLE acme.default.some_table
  PARTITION (country = CURRENT_RECIPIENT().country);
```

## <a id="deletion-vectors" />Add tables with deletion vectors or column mapping to a share

Deletion vectors are a storage optimization feature that you can enable on Delta tables. See [Deletion vectors in Databricks](https://docs.databricks.com/gcp/en/tables/features/deletion-vectors.md).

Databricks also supports column mapping for Delta tables. See [Rename and drop columns with Delta Lake column mapping](https://docs.databricks.com/gcp/en/tables/features/column-mapping.md).

To share a table with deletion vectors or column mapping, you must share it with history. See [Add tables to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#add-tables).

When you share a table with deletion vectors or column mapping, recipients can query the table using a SQL warehouse, a compute running Databricks Runtime 14.1 or above, or a compute that is running open source `delta-sharing-spark` 3.1 or above. See [Read tables with deletion vectors or column mapping enabled](https://docs.databricks.com/gcp/en/opensharing/read-data-databricks.md#deletion-vectors) and [Read tables with deletion vectors or column mapping enabled](https://docs.databricks.com/gcp/en/opensharing/read-data-databricks.md#deletion-vectors).

## <a id="schemas" />Add schemas to a share

Check that you meet the [requirements](https://docs.databricks.com/gcp/en/opensharing/create-share.md#requirements) before adding schemas to a share.

Adding an entire schema to a share provides your recipients with access to all of the data assets in the schema at the time that you create the share, as well as any assets that are added to the schema over time. This includes all tables, views, volumes, and agent skills in the schema. Tables shared this way always include full history. Agent skills in the schema are shared with Databricks recipients only.

### Share schemas with a recipient

To add a schema to a share, follow the instructions in [Add tables to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#add-tables), paying attention to the content that specifies how to add a schema.

Adding, updating, or removing a schema using SQL requires a SQL warehouse or compute running Databricks Runtime 13.3 LTS or above. Doing the same using Catalog Explorer has no compute requirements.

### <a id="schema-limitations" />Limitations

* You can share schemas even if they include unsupported data assets. These assets are filtered out and not shared with recipients. Unsupported data assets include the following:
  * Tables that use liquid clustering with partition filtering
  * R2 tables with V2 checkpoint
  * Tables with collations enabled
  * Tables with row filters or columns masks
  * `SHALLOW CLONE` tables
  * [Foreign key constraints](https://docs.databricks.com/gcp/en/tables/constraints.md) in shared tables

* Table aliases, partitions, and volume aliases are not available if you share an entire schema. If you have created aliases or partitions for any assets in the schema, these are removed when you add the entire schema to the share.

* If you want to specify advanced options for a table or volume in the schema, you must share the table or volume using SQL and give the table or volume an alias with a different schema name.

* Schema-level aliasing is not supported. Schemas with the same name from different catalogs can't be added to the same share. Instead, share individual tables with aliased schema names.

## <a id="abac" />Add tables and schemas secured by ABAC policies to a share

[Attribute-based access control (ABAC)](https://docs.databricks.com/gcp/en/data-governance/unity-catalog/abac/index.md) is a data governance model that provides flexible, scalable, and centralized access control across Databricks.

You can share a table or schema secured by ABAC policies like standard tables. To learn how to apply ABAC policies to your data assets, see [Create and manage row filter and column mask policies](https://docs.databricks.com/gcp/en/data-governance/unity-catalog/abac/policies.md).

However, you must be a *privileged user*. A privileged user is the share owner *and* a user who is excluded from the ABAC policies applied to the data asset. The policy does not govern the recipient's access. Recipients have full access to the shared asset. [ABAC limitations](https://docs.databricks.com/gcp/en/data-governance/unity-catalog/abac/requirements.md) apply.

## <a id="streaming-tables" />Add streaming tables to a share

Streaming tables are regular Delta tables with extra support for streaming or incremental data processing. Streaming tables are designed for append-only data sources and process each input only one time. See [Use standalone streaming tables](https://docs.databricks.com/gcp/en/sql/mv-st/streaming.md).

Check that you meet the [requirements](https://docs.databricks.com/gcp/en/opensharing/create-share.md#requirements) before adding streaming tables to a share.

### Additional requirements

* You must enable **Serverless compute for workflows, notebooks, and Lakeflow pipelines** in the account where streaming table sharing is set up. See [Connect to serverless compute](https://docs.databricks.com/gcp/en/compute/serverless/index.md).

- If your workspace has workspace-catalog bindings enabled, check that the workspace has read and write access to the catalog the streaming table is in. For more information, see [Workspace-catalog binding](https://docs.databricks.com/gcp/en/data-governance/unity-catalog/access-control/workspace-catalog-binding.md).
- Shareable streaming tables must be defined on Delta tables or other shareable streaming tables or views.
- You must use a SQL warehouse or a compute on Databricks Runtime 13.3 LTS or above when you add a streaming table to a share.

### Limitations

* The streaming table cannot have row filters and column masks.
  * The base table of the streaming table can have row filters and column masks.
* The streaming table cannot have partition filters. Instead, create a view on top of the streaming table.
* Databricks-to-Open sharing recipients can only read the current snapshot of the streaming table. Time travel, query history, streaming reads, and CDF are not supported for open recipients. If your recipients need CDF, share a regular Delta table with CDF enabled.
* If the recipient doesn't have direct access to the underlying data, `LIMIT` clauses and predicate pushdown aren't supported. The system fully materializes all query results before returning them to the recipient, regardless of query filters. See [Do recipients have direct access to the underlying data in shared views, materialized views, and streaming tables?](https://docs.databricks.com/gcp/en/opensharing/index.md#accessing-views).
* General limitations for streaming tables also apply. See [Streaming table limitations](https://docs.databricks.com/gcp/en/ldp/concepts/streaming-tables.md#streaming-table-limitations).

### Share streaming tables with a recipient

To add streaming tables to a share:

#### Catalog Explorer

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/gcp/en/images/product-icons/DataIcon.svg) **Catalog**.

2. At the top of the **Catalog** pane, click the ![Gear icon.](https://docs.databricks.com/gcp/en/images/product-icons/GearIcon.svg) gear icon and select **OpenSharing**.

   Alternatively, in the upper-right corner, click **Share > OpenSharing**.

3. On the **Shared by me** tab, find the share you want to add a streaming table to and click its name.

4. Click **Manage assets > Edit assets**.

5. On the **Edit assets** page, search or browse for the streaming table that you want to share and select it.

6. (Optional) In the **Alias** column, click ![Speech bubble plus icon.](https://docs.databricks.com/gcp/en/images/product-icons/SpeechBubblePlusIcon.svg) to specify an alias, or alternate streaming table name, to make the streaming table name more readable. The alias is the name that the recipient sees and must use in queries. Recipients cannot use the actual streaming table name if an alias is specified.

7. Click **Save**.

#### SQL

Run the following command in a notebook or the Databricks SQL query editor.

```sql
ALTER SHARE <share_name> ADD TABLE <st_name> [COMMENT <comment>] [AS <shared_st_name>];
```

#### CLI

Run the following Databricks CLI command.

```bash
databricks shares update <share-name> \
  --json '{
    “updates”: [
      {
        “action”: “ADD”,
        “data_object”: {
          “name”: “<st-full-name>",
          “data_object_type”: “TABLE”,
          “comment”: “<comment>”
        }
      }
    ]
  }'
```

For information about removing streaming tables from a share, see [Update shares](https://docs.databricks.com/gcp/en/opensharing/manage-share.md#update).

## <a id="managed-iceberg" />Add managed Iceberg tables to a share

Apache Iceberg is an open source table format for analytics workloads. In Databricks, you can create [Iceberg tables](https://docs.databricks.com/gcp/en/iceberg/index.md) in Unity Catalog, known as [managed Iceberg tables](https://docs.databricks.com/gcp/en/tables/managed.md).

Check that you meet the [requirements](https://docs.databricks.com/gcp/en/opensharing/create-share.md#requirements) before adding managed Iceberg tables to a share. Iceberg table and managed Iceberg table limitations apply. See [Limitations](https://docs.databricks.com/gcp/en/iceberg/index.md#iceberg-limitations).

To add managed Iceberg tables to a share:

### Catalog Explorer

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/gcp/en/images/product-icons/DataIcon.svg) **Catalog**.

2. At the top of the **Catalog** pane, click the ![Gear icon.](https://docs.databricks.com/gcp/en/images/product-icons/GearIcon.svg) gear icon and select **OpenSharing**.

   Alternatively, in the upper-right corner, click **Share > OpenSharing**.

3. On the **Shared by me** tab, find the share you want to add a managed Iceberg table to and click its name.

4. Click **Manage assets** > **Edit assets**.

5. On the **Edit assets** page, search or browse for the managed Iceberg table that you want to share and select it.

6. (Optional) In the **Alias** column, click ![Speech bubble plus icon.](https://docs.databricks.com/gcp/en/images/product-icons/SpeechBubblePlusIcon.svg) to specify an alias, or alternate managed Iceberg table name, to make the name more readable. The alias is the name that the recipient sees and must use in queries. Recipients cannot use the actual managed Iceberg table name if an alias is specified.

7. Click **Save**.

### SQL

Run the following command in a notebook or the Databricks SQL query editor. Optionally, specify `<shared_iceberg_table_name>` to expose the managed Iceberg table under a different name.

```sql
ALTER SHARE <share_name> ADD TABLE <managed_iceberg_name> [COMMENT <comment>] [AS <shared_iceberg_table_name>];
```

### CLI

Run the following Databricks CLI command.

```bash
databricks shares update <share-name> \
  --json '{
    “updates”: [
      {
        “action”: “ADD”,
        “data_object”: {
          “name”: “<managed-iceberg-full-name>",
          “data_object_type”: “TABLE”,
          “comment”: “<comment>”
        }
      }
    ]
  }'
```

## <a id="foreign-asset" />Add foreign schemas or tables to a share

Lakehouse Federation enables you to use Databricks to run queries against external data sources such as PostgreSQL and MySQL. A foreign table's data and metadata stay in the source system. Databricks queries the data there through query federation, and Unity Catalog adds data governance. A foreign schema is a schema of these tables. To learn more about connecting to external sources, see [Connect to external databases and catalogs](https://docs.databricks.com/gcp/en/query-federation/index.md).

OpenSharing enables you to securely share foreign data from its original location, without copying data into Databricks, complex network setups, or credential transfers.

> [!NOTE]
>
> This is different from [foreign Delta table](https://docs.databricks.com/gcp/en/opensharing/create-share.md#foreign-delta) sharing, which shares Delta-format tables registered in a foreign catalog such as OneLake or a Hive metastore.

Check that you meet the [requirements](https://docs.databricks.com/gcp/en/opensharing/create-share.md#requirements) before adding foreign schemas or tables to a share.

### Additional requirements

* You must enable **Serverless compute for workflows, notebooks, and Lakeflow pipelines** in the account where foreign schema or foreign table sharing is set up. See [Connect to serverless compute](https://docs.databricks.com/gcp/en/compute/serverless/index.md).

* When sharing foreign schemas and tables, the data is queried and temporarily materialized on the provider's side. By default, the materialized data is stored in a hidden schema using Databricks [default storage](https://docs.databricks.com/gcp/en/storage/default-storage.md). Verify that you meet the [requirements](https://docs.databricks.com/gcp/en/storage/default-storage.md#requirements) and observe the [limitations](https://docs.databricks.com/gcp/en/storage/default-storage.md#limitations) for default storage.

  For details about default storage regional availability, see [Serverless availability](https://docs.databricks.com/gcp/en/resources/feature-region-support.md#serverless-gcp).

  To opt out the use of Databricks default storage and use your own storage for temporary materialization, open a [support case](https://docs.databricks.com/gcp/en/resources/support.md).

  > [!IMPORTANT]
  >
  > Foreign tables that are too large to materialize can't be shared. If materialization exceeds limits, the query fails.

### <a id="foreign-asset-limits" />Limitations

* Shared foreign tables don't support `LIMIT` clauses or predicate pushdown. The system fully materializes all query results before returning them to the recipient, regardless of query filters.

### Recommended usage patterns

Query results are generated on-demand for each query, so foreign table and schema sharing might not be as cost-efficient compared to sharing tables or materialized views. Databricks recommends the following to improve performance:

* Keep the size of typical query results less than 10 GBs.
* Use ad-hoc exploratory queries instead of frequent data dumps.
* When using cloud-token sharing, consider sharing materialized views created on top of foreign tables for cost-efficiency and better performance.

### Share the foreign schema or table with a recipient

To add foreign schemas or tables to a share, use Catalog Explorer, the Databricks Unity Catalog CLI, or SQL commands in a Databricks notebook or the Databricks SQL query editor.

#### Catalog Explorer

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/gcp/en/images/product-icons/DataIcon.svg) **Catalog**.

2. At the top of the **Catalog** pane, click the ![Gear icon.](https://docs.databricks.com/gcp/en/images/product-icons/GearIcon.svg) gear icon and select **OpenSharing**.

   Alternatively, in the upper-right corner, click **Share > OpenSharing**.

3. On the **Shared by me** tab, find the share you want to add a foreign table or schema to and click its name.

4. Click **Manage assets > Edit assets**.

5. On the **Edit assets** page, search or browse for the foreign table or schema that you want to share and select it.

6. (Optional) In the **Alias** column, click ![Speech bubble plus icon.](https://docs.databricks.com/gcp/en/images/product-icons/SpeechBubblePlusIcon.svg) to specify an alias, or alternate foreign schema or table name, to make the foreign schema or table name more readable. The alias is the name that the recipient sees and must use in queries. Recipients cannot use the actual foreign schema or table name if an alias is specified.

7. Click **Save**.

#### SQL

```sql
ALTER SHARE <share-name>
  ADD {TABLE | SCHEMA} {federated_catalog.federated_schema.federated_table | federated_catalog.federated_schema}
  [COMMENT "<comment>"]
  [AS <alias>];
```

Options include:

* `AS <alias>`: An alternate name, or alias, to make the data asset name more readable. The alias is the data asset name that the recipient sees and must use in queries. Recipients cannot use the actual name if an alias is specified. Use the format `<catalog-name>.<schema-name>.<view-name>`.
* `COMMENT "<comment>"`: Comments appear in the Catalog Explorer UI and when you list and display data asset details using SQL statements.

For more information about `ALTER SHARE` options, see [ALTER SHARE](https://docs.databricks.com/gcp/en/sql/language-manual/sql-ref-syntax-ddl-alter-share.md).

#### CLI

```bash
databricks shares update <share-name> \
  --json '{
    “updates”: [
      {
        “action”: “ADD”,
        “data_object”: {
          “name”: “<federated-data-asset-full-name>",
          “data_object_type”: “{TABLE | SCHEMA}”,
          "shared_as": "<foreign-data-asset-alias>",
          “comment”: “<comment>”
        }
      }
    ]
  }'
```

## <a id="foreign-iceberg" />Add foreign Iceberg tables to a share

Foreign Iceberg tables are tables federated from foreign Iceberg catalogs using Lakehouse Federation. To learn more about Apache Iceberg tables in Databricks, see [What is Apache Iceberg in Databricks?](https://docs.databricks.com/gcp/en/iceberg/index.md).

Before you begin, check that you meet the general [requirements](https://docs.databricks.com/gcp/en/opensharing/create-share.md#requirements) and [create a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#create-a-share-object). You can also share foreign Iceberg tables to recipients using external Iceberg clients. For more information, see [Enable sharing to external Iceberg clients](https://docs.databricks.com/gcp/en/opensharing/create-share.md#iceberg-clients).

> [!NOTE]
>
> To verify recipients receive the freshest data, periodically refresh your foreign Iceberg tables. Any `SELECT` query or `REFRESH TABLE` command refreshes the table metadata.
>
> Databricks recommends setting up a scheduled job so the foreign Iceberg table on Databricks stays in sync with the remote Iceberg source. For more information about scheduling refreshes, see [Schedule a query](https://docs.databricks.com/gcp/en/sql/user/queries/schedule-query.md).

### <a id="foreign-iceberg-reqs" />Additional requirements

* If you are sharing foreign Iceberg tables with open recipients not using Iceberg clients, you must use [default storage](https://docs.databricks.com/gcp/en/storage/default-storage.md). You must enable the **OpenSharing for Default Storage – Expanded Access** feature at the account level. See [Manage Databricks previews](https://docs.databricks.com/gcp/en/admin/workspace-settings/manage-previews.md).
* When sharing with open recipients not using Iceberg clients, the shared data is first filtered and materialized using your compute and storage. You might incur additional costs. For more information, see [How do I incur and check OpenSharing costs?](https://docs.databricks.com/gcp/en/opensharing/index.md#share-costs) and [Do recipients have direct access to the underlying data in shared views, materialized views, and streaming tables?](https://docs.databricks.com/gcp/en/opensharing/index.md#accessing-views).
* Foreign Iceberg tables must have Iceberg reads enabled. If Iceberg reads are not enabled, the table cannot be added to a share. See [Read Delta Lake tables with Iceberg clients](https://docs.databricks.com/gcp/en/delta/iceberg-reads.md).
  ![Foreign Iceberg table with Delta Uniform Iceberg section in details tab.](https://docs.databricks.com/gcp/en/images/opensharing/iceberg-delta-uniform.png)

### <a id="foreign-iceberg-limits" />Limitations

* Partitions aren't supported.
* When sharing with open recipients not using an Iceberg client, `LIMIT` clauses and predicate pushdown aren't supported. The system fully materializes all query results before returning them to the recipient, regardless of query filters.

### <a id="foreign-iceberg-add" />Add a foreign Iceberg table to a share

Foreign Iceberg tables are automatically shared with full history.

To add a foreign Iceberg table to a share:

#### Catalog Explorer

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/gcp/en/images/product-icons/DataIcon.svg) **Catalog**.

2. At the top of the **Catalog** pane, click the ![Gear icon.](https://docs.databricks.com/gcp/en/images/product-icons/GearIcon.svg) gear icon and select **OpenSharing**.

   Alternatively, in the upper-right corner, click **Share > OpenSharing**.

3. On the **Shared by me** tab, find the share you want to add a foreign Iceberg table to and click its name.

4. Click **Manage assets** > **Edit assets**.

5. On the **Edit assets** page, search or browse for the foreign Iceberg table that you want to share and select it.

6. (Optional) In the **Alias** column, click ![Speech bubble plus icon.](https://docs.databricks.com/gcp/en/images/product-icons/SpeechBubblePlusIcon.svg) to specify an alias. The alias is the name that the recipient sees and must use in queries.

7. Click **Save**.

#### SQL

Run the following command in a notebook or the Databricks SQL query editor. Optionally, specify `<shared_table_name>` to expose the foreign Iceberg table under a different name.

```sql
ALTER SHARE <share_name> ADD TABLE <foreign_iceberg_table_name> [COMMENT <comment>] [AS <shared_table_name>];
```

#### CLI

Run the following Databricks CLI command.

```bash
databricks shares update <share-name> \
  --json '{
    "updates": [
      {
        "action": "ADD",
        "data_object": {
          "name": "<foreign-iceberg-table-full-name>",
          "data_object_type": "TABLE",
          "comment": "<comment>"
        }
      }
    ]
  }'
```

## <a id="foreign-delta" />Add foreign Delta tables to a share

Foreign Delta tables are foreign tables in Delta Lake format that Databricks reads directly from source storage through catalog federation, for example, Delta tables in OneLake, a Hive metastore, or AWS Glue. To learn more, see [Work with foreign tables](https://docs.databricks.com/gcp/en/tables/foreign.md) and [What is catalog federation?](https://docs.databricks.com/gcp/en/query-federation/catalog-federation.md).

For Databricks recipients, foreign Delta tables are always shared with full history and without a partition filter, so recipients always read the source Delta files directly using [cloud tokens](https://docs.databricks.com/gcp/en/opensharing/create-share.md#cloud-token-eligibility). For Databricks-to-Open sharing recipients, the data is materialized on your side and delivered through pre-signed URLs.

> [!NOTE]
>
> This is different from [foreign table](https://docs.databricks.com/gcp/en/opensharing/create-share.md#foreign-asset) sharing, which shares query federation tables from sources such as PostgreSQL or MySQL.

Before you begin, check that you meet the general [requirements](https://docs.databricks.com/gcp/en/opensharing/create-share.md#requirements) and [create a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#create-a-share-object).

### <a id="foreign-delta-add" />Add a foreign Delta table to a share

To add a foreign Delta table to a share:

#### Catalog Explorer

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/gcp/en/images/product-icons/DataIcon.svg) **Catalog**.

2. At the top of the **Catalog** pane, click the ![Gear icon.](https://docs.databricks.com/gcp/en/images/product-icons/GearIcon.svg) gear icon and select **OpenSharing**.

   Alternatively, in the upper-right corner, click **Share > OpenSharing**.

3. On the **Shared by me** tab, find the share you want to add a foreign Delta table to and click its name.

4. Click **Manage assets** > **Edit assets**.

5. On the **Edit assets** page, search or browse for the foreign Delta table that you want to share and select it.

6. (Optional) In the **Alias** column, click ![Speech bubble plus icon.](https://docs.databricks.com/gcp/en/images/product-icons/SpeechBubblePlusIcon.svg) to specify an alias. The alias is the name that the recipient sees and must use in queries.

7. Click **Save**.

#### SQL

Run the following command in a notebook or the Databricks SQL query editor. Optionally, specify `<shared_table_name>` to expose the foreign Delta table under a different name.

```sql
ALTER SHARE <share_name> ADD TABLE <foreign_delta_table_name> [COMMENT <comment>] [AS <shared_table_name>];
```

#### CLI

Run the following Databricks CLI command.

```bash
databricks shares update <share-name> \
  --json '{
    "updates": [
      {
        "action": "ADD",
        "data_object": {
          "name": "<foreign-delta-table-full-name>",
          "data_object_type": "TABLE",
          "comment": "<comment>"
        }
      }
    ]
  }'
```

## <a id="views" />Add views to a share

Views are read-only objects created from one or more tables or other views. A view can be created from tables and other views that are contained in multiple schemas and catalogs in a Unity Catalog metastore. See [Create and manage views](https://docs.databricks.com/gcp/en/views/create-views.md).

When sharing views, the data is queried and temporarily materialized. The materialized data is stored in the storage location of the view's parent schema or catalog, or in the metastore root location.

Check that you meet the [requirements](https://docs.databricks.com/gcp/en/opensharing/create-share.md#requirements) before adding views to a share.

### Additional requirements

* You must enable **Serverless compute for workflows, notebooks, and Lakeflow pipelines** in the account where view sharing is set up. See [Connect to serverless compute](https://docs.databricks.com/gcp/en/compute/serverless/index.md).

- Shareable views must be defined on Delta tables, foreign tables, other shareable views, or local materialized views and streaming tables.
- You must use a SQL warehouse or a compute on Databricks Runtime 13.3 LTS or above when you add a view to a share.
- If your workspace has workspace-catalog bindings enabled, check that the workspace has read and write access to the catalog. For more information, see [Workspace-catalog binding](https://docs.databricks.com/gcp/en/data-governance/unity-catalog/access-control/workspace-catalog-binding.md).
- When sharing views, the data might be queried and temporarily materialized on the provider side, depending on the recipient's compute type and account relationship. The materialized data is stored in the storage location of the view's parent schema or catalog, or in the metastore root location. For details about when materialization occurs and who pays for it, see [Do recipients have direct access to the underlying data in shared views, materialized views, and streaming tables?](https://docs.databricks.com/gcp/en/opensharing/index.md#accessing-views) and [How do I incur and check OpenSharing costs?](https://docs.databricks.com/gcp/en/opensharing/index.md#share-costs).
- If the storage location has custom network configurations, such as a firewall or private link, you must verify that your recipients are allowlisted to connect to the storage location. For instructions on configuring firewall rules for serverless compute, see [Limit network egress for your workspace using a firewall](https://docs.databricks.com/gcp/en/security/network/classic/firewall.md).

### <a id="view-limitations" />Limitations

* You cannot share views that reference shared tables or shared views.
* If the recipient doesn't have direct access to the underlying data, `LIMIT` clauses and predicate pushdown aren't supported. The system fully materializes all query results before returning them to the recipient, regardless of query filters. See [Do recipients have direct access to the underlying data in shared views, materialized views, and streaming tables?](https://docs.databricks.com/gcp/en/opensharing/index.md#accessing-views).

### Share views with a recipient

This section describes how to add views to a share using Catalog Explorer, Databricks CLI, or SQL commands in a Databricks notebook or the Databricks SQL query editor. If you prefer to use the Unity Catalog REST API, see [PATCH /api/2.1/unity-catalog/shares/](https://docs.databricks.com/api/workspace/shares/update) in the REST API reference.

#### Catalog Explorer

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/gcp/en/images/product-icons/DataIcon.svg) **Catalog**.

2. At the top of the **Catalog** pane, click the ![Gear icon.](https://docs.databricks.com/gcp/en/images/product-icons/GearIcon.svg) gear icon and select **OpenSharing**.

   Alternatively, in the upper-right corner, click **Share > OpenSharing**.

3. On the **Shared by me** tab, find the share you want to add a view to and click its name.

4. Click **Manage assets > Add data assets**.

5. On the **Add tables** page, search or browse for the view that you want to share and select it.

6. (Optional) Click ![Speech bubble plus icon.](https://docs.databricks.com/gcp/en/images/product-icons/SpeechBubblePlusIcon.svg) under the **Alias** column to specify an alternate view name, or **Alias**, to make the view name more readable. The alias is the name that the recipient sees and must use in queries. Recipients cannot use the actual view name if an alias is specified.

7. Click **Save**.

#### SQL

Run the following command in a notebook or the Databricks SQL query editor:

```sql
ALTER SHARE <share-name> ADD VIEW <catalog-name>.<schema-name>.<view-name>
   [COMMENT "<comment>"]
   [AS <alias>];
```

Options include:

* `AS <alias>`: An alternate view name, or alias, to make the view name more readable. The alias is the view name that the recipient sees and must use in queries. Recipients cannot use the actual view name if an alias is specified. Use the format `<schema-name>.<view-name>`.
* `COMMENT "<comment>"`: Comments appear in the Catalog Explorer UI and when you list and display view details using SQL statements.

For more information about `ALTER SHARE` options, see [ALTER SHARE](https://docs.databricks.com/gcp/en/sql/language-manual/sql-ref-syntax-ddl-alter-share.md).

#### CLI

Run the following Databricks CLI command:

```bash
databricks shares update <share-name> \
  --json '{
    "updates": [
      {
        "action": "ADD",
        "data_object": {
          "name": "<view-full-name>",
          "data_object_type": "VIEW",
          "shared_as": "<view-alias>"
        }
      }
    ]
  }'
```

`"shared_as": "<view-alias>"` is optional and provides an alternate view name, or alias, to make the view name more readable. The alias is the view name that the recipient sees and must use in queries. Recipients cannot use the actual view name if an alias is specified. Use the format `<schema-name>.<view-name>`.

To learn about additional parameters, run `databricks shares update --help` or see [PATCH /api/2.1/unity-catalog/shares/](https://docs.databricks.com/api/workspace/shares/update) in the REST API reference.

For information about removing views from a share, see [Update shares](https://docs.databricks.com/gcp/en/opensharing/manage-share.md#update).

## <a id="dynamic-views" />Add dynamic views to a share to filter rows and columns

You can use dynamic views to configure fine-grained access control to table data, including:

* Security at the level of columns or rows.
* Data masking.

When you create a dynamic view that uses the [CURRENT\_RECIPIENT() function](https://docs.databricks.com/gcp/en/sql/language-manual/functions/current_recipient.md), you can limit recipient access according to properties that you specify in the recipient definition.

This section provides examples of restricting recipient access to table data at both the row and column level using a dynamic view.

### Requirements

* Check that you meet the [requirements](https://docs.databricks.com/gcp/en/opensharing/create-share.md#requirements) for adding a view to a share.
* **Databricks Runtime version**: The `CURRENT_RECIPIENT` function is supported in Databricks Runtime 14.2 and above.

### Limitations

* All limitations for [view sharing](https://docs.databricks.com/gcp/en/opensharing/create-share.md#views) apply.
* When a provider shares a view that uses the `CURRENT_RECIPIENT` function, the provider can't query the view directly because of the sharing context. To test such a dynamic view, the provider must share the view with themselves and query the view as a recipient.
* Providers cannot create a view that references a dynamic view.

### Set a recipient property

In these examples, the table to be shared has a column named `country`, and only recipients with a matching `country` property can view certain rows or columns.

You can set recipient properties using Catalog Explorer or SQL commands in a Databricks notebook or the SQL query editor.

#### Catalog Explorer

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/gcp/en/images/product-icons/DataIcon.svg) **Catalog**.

2. At the top of the **Catalog** pane, click the ![Gear icon.](https://docs.databricks.com/gcp/en/images/product-icons/GearIcon.svg) gear icon and select **OpenSharing**.

   Alternatively, in the upper-right corner, click **Share > OpenSharing**.

3. On the **Recipients** tab, find the recipient you want to add the properties to and click its name.

4. On the lower‑right side of the page, under **Recipient properties**, click the ![Pencil icon.](https://docs.databricks.com/gcp/en/images/product-icons/PencilIcon.svg) pencil next to **databricks.metastoreID** for a Databricks recipient or next to **databricks.name** for an open recipient.

5. On the **Edit recipient properties** dialog, enter the column name as a key (in this case `country`) and the value you want to filter by as the value (for example, `CA`).

6. Click **Save**.

#### SQL

To set the property on the recipient, use `ALTER RECIPIENT`. In this example, the `country` property is set to `CA`.

```sql
ALTER RECIPIENT recipient1 SET PROPERTIES ('country' = 'CA');
```

### Create a dynamic view with row-level permission for recipients

In this example, only recipients with a matching `country` property can view certain rows.

```sql
CREATE VIEW my_catalog.default.view1 AS
  SELECT * FROM my_catalog.default.my_table
  WHERE country = CURRENT_RECIPIENT('country');
```

Another option is for the data provider to maintain a separate mapping table that maps fact table fields to recipient properties. This allows recipient properties and fact table fields to be decoupled for greater flexibility.

### Create a dynamic view with column-level permission for recipients

In this example, only recipients that match the `country` property can view certain columns. Others see the data returned as `REDACTED`:

```sql
CREATE VIEW my_catalog.default.view2 AS
  SELECT
  CASE
    WHEN CURRENT_RECIPIENT('country') = 'US' THEN pii
    ELSE 'REDACTED'
  END AS pii
  FROM my_catalog.default.my_table;
```

### Share the dynamic view with a recipient

To share the dynamic view with a recipient, use the same SQL commands or UI procedure as you would for a standard view. See [Add views to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#views).

## <a id="materialized-views" />Add materialized views to a share

Like views, materialized views are the results of a query, and you can access them like you would a table. Unlike regular views, the results of a materialized view reflect the state of data when the materialized view was last refreshed. For more details about materialized views, see [Use standalone materialized views](https://docs.databricks.com/gcp/en/sql/mv-st/materialized.md).

Check that you meet the [requirements](https://docs.databricks.com/gcp/en/opensharing/create-share.md#requirements) before adding materialized views to a share.

### Additional requirements

* You must enable **Serverless compute for workflows, notebooks, and Lakeflow pipelines** in the account where materialized view sharing is set up. See [Connect to serverless compute](https://docs.databricks.com/gcp/en/compute/serverless/index.md).

- If your workspace has workspace-catalog bindings enabled, check that the workspace has read and write access to the catalog containing the materialized view. For more information, see [Workspace-catalog binding](https://docs.databricks.com/gcp/en/data-governance/unity-catalog/access-control/workspace-catalog-binding.md).
- Shareable materialized views must be defined on Delta tables or other shareable streaming tables, views, or materialized views.
- You must use a SQL warehouse or a compute on Databricks Runtime 13.3 LTS or above when you add a materialized view to a share.

### Limitations

* The materialized view cannot have row filters, but the base table of the materialized view can have row filters and column masks.
* The materialized view cannot have partition filters. Instead, create a view on top of the materialized view.
* Databricks-to-Open sharing recipients can only read the current snapshot of the materialized view. Streaming reads are not supported for open recipients.
* If the recipient doesn't have direct access to the underlying data, `LIMIT` clauses and predicate pushdown aren't supported. The system fully materializes all query results before returning them to the recipient, regardless of query filters. See [Do recipients have direct access to the underlying data in shared views, materialized views, and streaming tables?](https://docs.databricks.com/gcp/en/opensharing/index.md#accessing-views).
* General limitations for materialized views also apply. See [Materialized view limitations](https://docs.databricks.com/gcp/en/ldp/concepts/materialized-views.md#limitations).

### Share materialized views with a recipient

This section describes how to add materialized views to a share using Catalog Explorer, Databricks CLI, or SQL commands in a Databricks notebook or the Databricks SQL query editor. If you prefer to use the REST API, see [PATCH /api/2.1/unity-catalog/shares/](https://docs.databricks.com/api/workspace/shares/update) in the REST API reference.

#### Catalog Explorer

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/gcp/en/images/product-icons/DataIcon.svg) **Catalog**.

2. At the top of the **Catalog** pane, click the ![Gear icon.](https://docs.databricks.com/gcp/en/images/product-icons/GearIcon.svg) gear icon and select **OpenSharing**.

   Alternatively, in the upper-right corner, click **Share > OpenSharing**.

3. On the **Shared by me** tab, find the share you want to add a materialized view to and click its name.

4. Click **Manage assets > Edit assets**.

5. On the **Edit assets** page, search or browse for the materialized view that you want to share and select it.

6. (Optional) In the **Alias** column, click ![Speech bubble plus icon.](https://docs.databricks.com/gcp/en/images/product-icons/SpeechBubblePlusIcon.svg) to specify an alias, or alternate materialized view name, to make the materialized view name more readable. The alias is the name that the recipient sees and must use in queries. Recipients cannot use the actual materialized view name if an alias is specified.

7. Click **Save**.

#### SQL

Run the following command in a notebook or the Databricks SQL query editor.

```sql
ALTER SHARE <share_name> ADD MATERIALIZED VIEW <mv_name> [COMMENT <comment>] [AS <shared_mv_name>];
```

#### CLI

```bash
databricks shares update <share-name> \
  --json '{
    “updates”: [
      {
        “action”: “ADD”,
        “data_object”: {
          “name”: “<mat-view-full-name>”,
          “data_object_type”: “MATERIALIZED_VIEW”,
          “comment”: “<comment>”
        }
      }
    ]
  }'
```

For information about removing materialized views from a share, see [Update shares](https://docs.databricks.com/gcp/en/opensharing/manage-share.md#update).

## <a id="metric-views" />Add metric views to a share

Metric views define business metrics one time by separating measures from the dimensions used to group, filter, and aggregate them. For more details about metric views, see [Unity Catalog metric views](https://docs.databricks.com/gcp/en/uc-semantics/metric-views/index.md).

Check that you meet the [requirements](https://docs.databricks.com/gcp/en/opensharing/create-share.md#requirements) before adding metric views to a share.

### Limitations

* You can only share metric views with a Databricks recipient.
* A metric view definition can only use a subset of Databricks built-in functions and operators, the same subset supported for shared views. See [Functions supported in Databricks-to-Databricks view sharing](https://docs.databricks.com/gcp/en/opensharing/shared-view-functions-data-databricks.md).
* You cannot share a metric view that references tables with row filters or column masks.
* You cannot share a metric view that references tables governed by [ABAC policies](https://docs.databricks.com/gcp/en/data-governance/unity-catalog/abac/index.md).
* You cannot share a metric view that references tables with [catalog commits](https://docs.databricks.com/gcp/en/tables/features/catalog-commits.md) enabled. To share the metric view, drop the `catalogManaged` table feature from the source tables. See [Drop a Delta Lake table feature and downgrade table protocol](https://docs.databricks.com/gcp/en/tables/features/drop-feature.md).

If a metric view that references tables with row filters, column masks, or ABAC policies is shared anyway, recipients are blocked from querying it.

### Share metric views with a recipient

This section describes how to add metric views to a share using Catalog Explorer, Databricks CLI, or SQL commands in a Databricks notebook or the Databricks SQL query editor. If you prefer to use the Unity Catalog REST API, see [PATCH /api/2.1/unity-catalog/shares/](https://docs.databricks.com/api/workspace/shares/update) in the REST API reference.

In SQL, the Databricks CLI, and Python, a metric view uses the `VIEW` data type.

#### Catalog Explorer

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/gcp/en/images/product-icons/DataIcon.svg) **Catalog**.

2. In the **Catalog** pane, at the top, click the ![Gear icon.](https://docs.databricks.com/gcp/en/images/product-icons/GearIcon.svg) gear icon and select **OpenSharing**.

   Alternatively, in the upper-right corner, click **Share > OpenSharing**.

3. On the **Shared by me** tab, find the share you want to add a metric view to and click its name.

4. Click **Manage assets > Add data assets**.

5. On the **Add tables** page, search or browse for the metric view that you want to share and select it.

6. (Optional) Click ![Speech bubble plus icon.](https://docs.databricks.com/gcp/en/images/product-icons/SpeechBubblePlusIcon.svg) under the **Alias** column to specify an alternate name, or **Alias**, to make the metric view name more readable. The alias is the name that the recipient sees and must use in queries. Recipients cannot use the actual metric view name if an alias is specified.

7. Click **Save**.

#### SQL

Because a metric view uses the `VIEW` data type, run the following command in a notebook or the Databricks SQL query editor:

```sql
ALTER SHARE <share-name> ADD VIEW <catalog-name>.<schema-name>.<metric-view-name>
   [COMMENT "<comment>"]
   [AS <alias>];
```

Options include:

* `AS <alias>`: An alternate name, or alias, to make the metric view name more readable. The alias is the name that the recipient sees and must use in queries. Recipients cannot use the actual metric view name if an alias is specified. Use the format `<schema-name>.<metric-view-name>`.
* `COMMENT "<comment>"`: Comments appear in the Catalog Explorer UI and when you list and display metric view details using SQL statements.

For more information about `ALTER SHARE` options, see [ALTER SHARE](https://docs.databricks.com/gcp/en/sql/language-manual/sql-ref-syntax-ddl-alter-share.md).

#### CLI

Because a metric view uses the `VIEW` data type, run the following Databricks CLI command:

```bash
databricks shares update <share-name> \
  --json '{
    "updates": [
      {
        "action": "ADD",
        "data_object": {
          "name": "<metric-view-full-name>",
          "data_object_type": "VIEW",
          "shared_as": "<metric-view-alias>"
        }
      }
    ]
  }'
```

`"shared_as": "<metric-view-alias>"` is optional and provides an alternate name, or alias, to make the metric view name more readable. The alias is the name that the recipient sees and must use in queries. Recipients cannot use the actual metric view name if an alias is specified. Use the format `<schema-name>.<metric-view-name>`.

To learn about additional parameters, run `databricks shares update --help` or see [PATCH /api/2.1/unity-catalog/shares/](https://docs.databricks.com/api/workspace/shares/update) in the REST API reference.

For information about removing metric views from a share, see [Update shares](https://docs.databricks.com/gcp/en/opensharing/manage-share.md#update).

## <a id="volumes" />Add volumes to a share

Volumes are Unity Catalog objects that represent a logical volume of storage in a cloud object storage location. They are intended primarily to provide governance over non-tabular data assets. See [What are Unity Catalog volumes?](https://docs.databricks.com/gcp/en/volumes/index.md).

Check that you meet the [requirements](https://docs.databricks.com/gcp/en/opensharing/create-share.md#requirements) before adding volumes to a share.

### Additional requirements

* Volume sharing is supported only in Databricks-to-Databricks sharing.
* You must use a SQL warehouse on version 2023.50 or above or a compute resource on Databricks Runtime 14.1 or above when you add a volume to a share.
* If the volume storage on the provider side has custom network configurations (such as a firewall or private link), then the provider must verify that the recipient's data plane addresses are properly allowlisted to be able to connect to the storage location of the volume. Catalog Explorer might not display the volumes correctly on the recipient side.

> [!NOTE]
>
> Volume comments are included in shares that are shared with a recipient using Databricks-to-Databricks sharing on or after July 25, 2024. If you want to start sharing comments through a share that was shared with a recipient before the release date, you must revoke and re-grant recipient access to trigger comment sharing.

### Share volumes with a recipient

This section describes how to add volumes to a share using Catalog Explorer, the Databricks CLI, or SQL commands in a Databricks notebook or SQL query editor. If you prefer to use the Unity Catalog REST API, see [PATCH
/api/2.1/unity-catalog/shares/](https://docs.databricks.com/api/workspace/shares/update) in the REST API reference.

#### Catalog Explorer

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/gcp/en/images/product-icons/DataIcon.svg) **Catalog**.

2. At the top of the **Catalog** pane, click the ![Gear icon.](https://docs.databricks.com/gcp/en/images/product-icons/GearIcon.svg) gear icon and select **OpenSharing**.

   Alternatively, in the upper-right corner, click **Share > OpenSharing**.

3. On the **Shared by me** tab, find the share you want to add a volume to and click its name.

4. Click **Manage assets > Edit assets**.

5. On the **Edit assets** page, search or browse for the volume that you want to share and select it.

   Alternatively, you can select the entire schema that contains the volume. See [Add schemas to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#schemas).

6. (Optional) Click ![Speech bubble plus icon.](https://docs.databricks.com/gcp/en/images/product-icons/SpeechBubblePlusIcon.svg) under the **Alias** column to specify an alternate volume name, or **Alias**, to make the volume name more readable.

   Aliases are not available if you select an entire schema.

   The alias is the name that the recipient sees and must use in queries. If an alias is specified, recipients cannot use the actual volume name.

7. Click **Save**.

#### SQL

Run the following command in a notebook or the Databricks SQL query editor:

```sql
ALTER SHARE <share-name> ADD VOLUME <catalog-name>.<schema-name>.<volume-name>
   [COMMENT "<comment>"]
   [AS <alias>];
```

Options include:

* `AS <alias>`: An alternate volume name, or alias, to make the volume name more readable. The alias is the volume name that the recipient sees and must use in queries. Recipients cannot use the actual volume name if an alias is specified. Use the format `<schema-name>.<volume-name>`.
* `COMMENT "<comment>"`: Comments appear in the Catalog Explorer UI and when you list and display volume details using SQL statements.

For more information about `ALTER SHARE` options, see [ALTER SHARE](https://docs.databricks.com/gcp/en/sql/language-manual/sql-ref-syntax-ddl-alter-share.md).

#### CLI

Run the following command using Databricks CLI 0.210 or above:

```bash
 databricks shares update <share-name> \
   --json '{
     "updates": [
       {
         "action": "ADD",
         "data_object": {
           "name": "<volume-full-name>",
           "data_object_type": "VOLUME",
           "string_shared_as": "<volume-alias>"
         }
       }
     ]
   }'
```

`"string_shared_as": "<volume-alias>"` is optional and provides an alternate volume name, or alias, to make the volume name more readable. The alias is the volume name that the recipient sees and must use in queries. Recipients cannot use the actual volume name if an alias is specified. Use the format `<schema-name>.<volume-name>`.

To learn about additional parameters, run `databricks shares update --help` or see [PATCH /api/2.1/unity-catalog/shares/](https://docs.databricks.com/api/workspace/shares/update) in the REST API reference.

For information about removing volumes from a share, see [Update shares](https://docs.databricks.com/gcp/en/opensharing/manage-share.md#update).

## <a id="skills" />Add agent skills to a share

> [!NOTE]
>
> This feature is generally available. For some accounts, an account admin must turn on **Agent Skill Sharing** from the account console **Previews** page. See [ Manage account-level previews](https://docs.databricks.com/gcp/en/admin/workspace-settings/manage-previews.md#account).

Unity Catalog agent skills are governed instructions that teach AI agents how to work with your data or domain. To learn how to create them, see [Tutorial: Create and share Unity Gateway Skills](https://docs.databricks.com/gcp/en/agents/uc-skills/create-share-uc-skills.md).

### Additional requirements

* Your account must also have the **Enhanced Unity AI Gateway** preview turned on. This preview is in [Beta](https://docs.databricks.com/gcp/en/release-notes/release-types.md). See [ Manage account-level previews](https://docs.databricks.com/gcp/en/admin/workspace-settings/manage-previews.md#account).
* Only finalized skills in managed catalogs can be shared.
* Skills in nested schemas can't be added to a share.
* Agent skills can be shared only with Databricks recipients. See [What is the OpenSharing Databricks-to-Databricks protocol?](https://docs.databricks.com/gcp/en/opensharing/share-data-databricks.md).

> [!NOTE]
> **Compliance security profile**
>
> If your workspace uses the [compliance security profile](https://docs.databricks.com/gcp/en/security/privacy/security-profile.md), you're responsible for making sure that sharing agent skills with recipients in other regions meets your compliance and data residency requirements. Skills are shared directly from your metastore to the recipient's metastore, and you choose who receives them.

Check that you meet the [requirements](https://docs.databricks.com/gcp/en/opensharing/create-share.md#requirements) before adding agent skills to a share.

### Share agent skills with a recipient

You can add agent skills to a share using Catalog Explorer or the Databricks CLI.

To add agent skills to a share:

#### Catalog Explorer

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/gcp/en/images/product-icons/DataIcon.svg) **Catalog**.

2. At the top of the **Catalog** pane, click the ![Gear icon.](https://docs.databricks.com/gcp/en/images/product-icons/GearIcon.svg) gear icon and select **OpenSharing**.

   Alternatively, in the upper-right corner, click **Share > OpenSharing**.

3. On the **Shared by me** tab, find the share you want to add an agent skill to and click its name.

4. Click **Manage assets > Edit assets**.

5. On the **Edit assets** page, search or browse for the agent skill that you want to share and select it.

   Alternatively, you can select the entire schema that contains the agent skill. Adding a schema to a share also shares the agent skills in that schema. See [Add schemas to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#schemas).

6. Click **Save**.

Alternatively, share an agent skill directly from its details page. In Catalog Explorer, navigate to the schema that contains the skill and click the skill's name. On the skill details page, click **Share**. The **Share** button doesn't appear for skills in nested schemas.

#### CLI

Run the following command using Databricks CLI 0.210 or above:

```bash
databricks shares update <share-name> \
  --json '{
    "updates": [
      {
        "action": "ADD",
        "data_object": {
          "name": "<skill-full-name>",
          "data_object_type": "SKILL",
          "string_shared_as": "<schema-name>.<skill-name>",
          "comment": "<comment>"
        }
      }
    ]
  }'
```

`"string_shared_as": "<schema-name>.<skill-name>"` is optional and provides an alias that the recipient sees instead of the skill's original name. If you don't specify an alias, one is generated from the original name. The alias must be unique in the share. `"comment"` is optional.

Table-only options, such as partitions, history, and change data feed, don't apply to agent skills.

To learn about additional parameters, run `databricks shares update --help` or see [PATCH /api/2.1/unity-catalog/shares/](https://docs.databricks.com/api/workspace/shares/update) in the REST API reference.

For information about removing agent skills from a share, see [Update shares](https://docs.databricks.com/gcp/en/opensharing/manage-share.md#update).

### <a id="skill-limitations" />Limitations

In addition to the [limitations for OpenSharing](https://docs.databricks.com/gcp/en/opensharing/index.md#limits), the following limitations apply to sharing agent skills:

* Agent skills can be shared only with Databricks recipients. Open recipients can't access shared agent skills.
* Shared agent skills are read-only for recipients. Recipients can't edit them, upload files to them, or delete them. The skill's name, comment, and contents come from the provider.
* You can't add agent skills to clean rooms.
* Agent skills can't be shared with SQL commands. Use Catalog Explorer or the Databricks CLI.

To share agent skills in a Databricks Marketplace listing, see [Create a Marketplace listing](https://docs.databricks.com/gcp/en/marketplace/create-listing.md).

## <a id="python-udfs" />Add Python UDFs to a share

User-defined functions (UDFs) allow you to reuse and share code that extends built-in functionality on Databricks. To learn how to create Python UDFs, see [Python scalar user-defined functions (UDFs)](https://docs.databricks.com/gcp/en/udf/python.md).

Check that you meet the [requirements](https://docs.databricks.com/gcp/en/opensharing/create-share.md#requirements) before adding Python UDFs to a share.

### Additional limitations

* You cannot share Python UDFs with an open recipient.

### Share Python UDFs with a recipient

This section describes how to add Python UDFs to a share using Catalog Explorer, the Databricks CLI, or SQL commands in a Databricks notebook or SQL query editor. If you prefer to use the Unity Catalog REST API, see [PATCH
/api/2.1/unity-catalog/shares/](https://docs.databricks.com/api/workspace/shares/update) in the REST API reference.

#### Catalog Explorer

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/gcp/en/images/product-icons/DataIcon.svg) **Catalog**.

2. At the top of the **Catalog** pane, click the ![Gear icon.](https://docs.databricks.com/gcp/en/images/product-icons/GearIcon.svg) gear icon and select **OpenSharing**.

   Alternatively, in the upper-right corner, click **Share > OpenSharing**.

3. On the **Shared by me** tab, find the share you want to add a Python UDF to and click its name.

4. Click **Manage assets > Edit assets**.

5. On the **Edit assets** page, search or browse for the Python UDF that you want to share and select it.

   Alternatively, you can select the entire schema that contains the Python UDF. See [Add schemas to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#schemas).

6. (Optional) Click ![Speech bubble plus icon.](https://docs.databricks.com/gcp/en/images/product-icons/SpeechBubblePlusIcon.svg) under the **Alias** column to specify an alternate Python UDF name, or **Alias**, to make the Python UDF name more readable.

   Aliases are not available if you select an entire schema.

   The alias is the name that the recipient sees and must use in queries. If an alias is specified, recipients cannot use the actual Python UDF name.

7. Click **Save**.

#### SQL

Run the following command, which uses `ADD MODEL`, in a notebook or the Databricks SQL query editor:

```sql
ALTER SHARE <share-name> ADD MODEL <catalog-name>.<schema-name>.<python-udf-name>
   [AS <alias>];
```

Options include:

* `AS <alias>`: An alternate Python UDF name, or alias, to make the Python UDF name more readable. The alias is the Python UDF name that the recipient sees and must use in queries. Recipients cannot use the actual Python UDF name if an alias is specified. Use the format `<schema-name>.<python-udf-name>`.

For more information about `ALTER SHARE` options, see [ALTER SHARE](https://docs.databricks.com/gcp/en/sql/language-manual/sql-ref-syntax-ddl-alter-share.md).

#### CLI

Run the following command, which specifies the object type as model, using Databricks CLI 0.210 or above:

```bash
 databricks shares update <share-name> \
   --json '{
     "updates": [
       {
         "action": "ADD",
         "data_object": {
           "name": "<python-udf-full-name>",
           "data_object_type": "MODEL",
           "string_shared_as": "<python-udf-alias>"
         }
       }
     ]
   }'
```

`"string_shared_as": "<python-udf-alias>"` is optional and provides an alternate Python UDF name, or alias, to make the Python UDF name more readable. The alias is the Python UDF name that the recipient sees and must use in queries. Recipients cannot use the actual Python UDF name if an alias is specified. Use the format `<schema-name>.<python-udf-name>`.

To learn about additional parameters, run `databricks shares update --help` or see [PATCH /api/2.1/unity-catalog/shares/](https://docs.databricks.com/api/workspace/shares/update) in the REST API reference.

## <a id="models" />Add models to a share

Check that you meet the [requirements](https://docs.databricks.com/gcp/en/opensharing/create-share.md#requirements) before adding models to a share.

> [!NOTE]
>
> Model comments and model version comments are included in shares that are shared using Databricks-to-Databricks sharing.

### Additional requirements

* Model sharing is supported only in Databricks-to-Databricks sharing.
* You must use a SQL warehouse on version 2023.50 or above or a compute resource on Databricks Runtime 14.0 or above when you add a model to a share.

### Share models with a recipient

This section describes how to add models to a share using Catalog Explorer, the Databricks CLI, or SQL commands in a Databricks notebook or SQL query editor. If you prefer to use the Unity Catalog REST API, see [PATCH
/api/2.1/unity-catalog/shares/](https://docs.databricks.com/api/workspace/shares/update) in the REST API reference.

To add models to a share:

#### Catalog Explorer

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/gcp/en/images/product-icons/DataIcon.svg) **Catalog**.

2. At the top of the **Catalog** pane, click the ![Gear icon.](https://docs.databricks.com/gcp/en/images/product-icons/GearIcon.svg) gear icon and select **OpenSharing**.

   Alternatively, in the upper-right corner, click **Share > OpenSharing**.

3. On the **Shared by me** tab, find the share you want to add a model to and click its name.

4. Click **Manage assets > Edit assets**.

5. On the **Edit assets** page, search or browse for the model that you want to share and select it.

   Alternatively, you can select the entire schema that contains the model. See [Add schemas to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#schemas).

6. (Optional) Click ![Speech bubble plus icon.](https://docs.databricks.com/gcp/en/images/product-icons/SpeechBubblePlusIcon.svg) under the **Alias** column to specify an alternate model name, or **Alias**, to make the model name more readable.

   Aliases are not available if you select an entire schema.

   The alias is the name that the recipient sees and must use in queries. Recipients cannot use the actual model name if an alias is specified.

7. Click **Save**.

#### SQL

Run the following command in a notebook or the Databricks SQL query editor:

```sql
ALTER SHARE <share-name> ADD MODEL <catalog-name>.<schema-name>.<model-name>
   [COMMENT "<comment>"]
   [AS <alias>];
```

Options include:

* `AS <alias>`: An alternate model name, or alias, to make the model name more readable. The alias is the model name that the recipient sees and must use in queries. Recipients cannot use the actual model name if an alias is specified. Use the format `<schema-name>.<model-name>`.
* `COMMENT "<comment>"`: Comments appear in the Catalog Explorer UI and when you list and display model details using SQL statements.

For more information about `ALTER SHARE` options, see [ALTER SHARE](https://docs.databricks.com/gcp/en/sql/language-manual/sql-ref-syntax-ddl-alter-share.md).

#### CLI

Run the following command using Databricks CLI 0.210 or above:

```bash
 databricks shares update <share-name> \
   --json '{
     "updates": [
       {
         "action": "ADD",
         "data_object": {
           "name": "<model-full-name>",
           "data_object_type": "MODEL",
           "string_shared_as": "<model-alias>"
         }
       }
     ]
   }'
```

`"string_shared_as": "<model-alias>"` is optional and provides an alternate model name, or alias, to make the model name more readable. The alias is the model name that the recipient sees and must use in queries. Recipients cannot use the actual model name if an alias is specified. Use the format `<schema-name>.<model-name>`.

To learn about additional parameters, run `databricks shares update --help` or see [PATCH /api/2.1/unity-catalog/shares/](https://docs.databricks.com/api/workspace/shares/update) in the REST API reference.

For information about removing models from a share, see [Update shares](https://docs.databricks.com/gcp/en/opensharing/manage-share.md#update).

## <a id="add-remove-notebook-files" />Add notebook files to a share

Check that you meet the [requirements](https://docs.databricks.com/gcp/en/opensharing/create-share.md#requirements) before adding notebook files to a share.

Use Catalog Explorer to add a notebook file to a share.

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/gcp/en/images/product-icons/DataIcon.svg) **Catalog**.
2. Click the **OpenSharing >** button.
3. On the **Shared by me** tab, find the share you want to add a notebook to and click its name.
4. Click **Manage assets** and select **Add notebook file**.
5. On the **Add notebook file** page, click the file icon to browse for the notebook you want to share.
   * Click the file you want to share and click **Select**.
   * (Optionally) specify a user-friendly alias for the file in the **Share as** field. This is the identifier that recipients see.
   * Under **Storage location**, enter the [external location](https://docs.databricks.com/gcp/en/connect/unity-catalog/cloud-storage/index.md#external-locations) in cloud storage where you want to store the notebook. You can specify a subpath under the defined external location. If you don't specify an external location, the notebook is stored in the metastore-level storage location (or “metastore root location”). If no root location is defined for the metastore, you must enter an external location here. See [Add managed storage to an existing metastore](https://docs.databricks.com/gcp/en/data-governance/unity-catalog/manage-metastore.md#add-storage).
6. Click **Save**.

The shared notebook file now appears in the **Notebook files** list on the **Assets** tab.

### Remove notebook files from shares

To remove a notebook file from a share:

1. In your Databricks workspace, click ![Data icon.](https://docs.databricks.com/gcp/en/images/product-icons/DataIcon.svg) **Catalog**.

2. At the top of the **Catalog** pane, click the ![Gear icon.](https://docs.databricks.com/gcp/en/images/product-icons/GearIcon.svg) gear icon and select **OpenSharing**.

   Alternatively, in the upper-right corner, click **Share > OpenSharing**.

3. On the **Shared by me** tab, find the share that includes the notebook, and click the share name.

4. On the **Assets** tab, find the notebook file you want to remove from the share.

5. Click the ![Kebab menu icon.](https://docs.databricks.com/gcp/en/images/product-icons/OverflowIcon.svg) kebab menu to the right of the row, and select **Delete notebook file**.

6. On the confirmation dialog, click **Delete**.

### Update notebook files in shares

To update a notebook that you have already shared, you must re-add it, giving it a new alias in the **Share as** field. Databricks recommends that you use a name that indicates the notebook's revised status, such as `<old-name>-update-1`. You may need to notify the recipient of the change. The recipient must select and clone the new notebook to take advantage of your update.

## <a id="iceberg-clients" />Enable sharing to external Iceberg clients

You can share Delta tables, managed Iceberg tables, foreign Iceberg tables, views, materialized views, and streaming tables with external Iceberg clients that use the Apache Iceberg REST Catalog API.

Before sharing, verify that you meet the [OpenSharing requirements](https://docs.databricks.com/gcp/en/opensharing/create-share.md#requirements) needed to add your data asset to a share.

> [!NOTE]
>
> This feature is different from [sharing managed Iceberg tables](https://docs.databricks.com/gcp/en/opensharing/create-share.md#managed-iceberg).

### Additional limitations

* Assets using default storage cannot be shared to external Iceberg clients. See [Default storage in Databricks](https://docs.databricks.com/gcp/en/storage/default-storage.md).

### Share with external Iceberg clients

To share data assets with external Iceberg clients:

1. If you are sharing a Delta table, configure each Delta table with `IcebergCompatV3` to expose it as an Iceberg-compatible table. This enables asynchronous generation of Iceberg metadata alongside standard Delta operations. Check that you meet the requirements and observe the limitations for Iceberg v3. To learn how to enable Iceberg v3 on a table, see [Create and use managed tables with Apache Iceberg v3](https://docs.databricks.com/gcp/en/iceberg/iceberg-v3.md).

   If you are sharing to Snowflake, only uniform-enabled tables appear for the recipient. Other tables are filtered.

   > [!NOTE]
   >
   > Use `DESCRIBE HISTORY` to confirm that Iceberg metadata generation completed before the table can be queried from Iceberg clients.

2. Add the data asset to a share. For detailed instructions, see:

   * [Add tables to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#add-tables)
   * [Add views to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#views)
   * [Add materialized views to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#materialized-views)
   * [Add streaming tables to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#streaming-tables)
   * [Add foreign Iceberg tables to a share](https://docs.databricks.com/gcp/en/opensharing/create-share.md#foreign-iceberg)

   > [!IMPORTANT]
   >
   > Provider-side data materialization is triggered if you share views, materialized views, or streaming tables, which might lead to the accumulation of compute costs. For more information, see [How do I incur and check OpenSharing costs?](https://docs.databricks.com/gcp/en/opensharing/index.md#share-costs).

3. Share with your open recipient. For instructions on how to create a recipient and grant them access to the share, see [Create a recipient object for non-Databricks users using bearer tokens (Databricks-to-Open sharing)](https://docs.databricks.com/gcp/en/opensharing/create-recipient-token.md) or [Enable Open ID Connect (OIDC) federation for OpenSharing recipients](https://docs.databricks.com/gcp/en/opensharing/create-recipient-oidc-fed.md).

## Additional resources

* [Manage access to OpenSharing data shares (for providers)](https://docs.databricks.com/gcp/en/opensharing/grant-access.md)
* [Manage shares for OpenSharing](https://docs.databricks.com/gcp/en/opensharing/manage-share.md)
* [Manage data recipients for OpenSharing](https://docs.databricks.com/gcp/en/opensharing/manage-recipients.md)
