Share
A share is a named collection of data and AI assets from a single Unity Catalog metastore that a provider makes available to recipients through Delta Sharing. A share is created empty; tables, views, volumes, models, notebook files, or whole schemas are added to it with update, and recipients are granted access to it through share permissions.
ShareInfo object
A share is a named collection of data and AI assets from a single Unity Catalog metastore that a provider makes available to recipients through Delta Sharing. A share is created empty; tables, views, volumes, models, notebook files, or whole schemas are added to it with update, and recipients are granted access to it through share permissions.
- namestring
Name of the share.
- ownerstring
Username of current owner of share.
- commentstring
User-provided free-form text description.
- storage_rootstring
Cloud storage path, within an external location, under which the share stores the notebook files added to it. When unset, notebook files are stored under the metastore root storage location.
- objectsarray of object
A list of shared data objects within the share.
Show child attributesHide child attributes
- namestring
A fully qualified name that uniquely identifies a data object. For example, a table's fully qualified name is in the format of
<catalog>.<schema>.<table>, a schema's is<catalog>.<schema>, a volume's, model's, or function's is<catalog>.<schema>.<object_name>, and a notebook file's is its workspace path.
- data_object_typestring
The type of the data object. One of TABLE, VIEW, MATERIALIZED_VIEW, STREAMING_TABLE, FOREIGN_TABLE, SCHEMA, VOLUME, MODEL, FUNCTION, FEATURE_SPEC, or NOTEBOOK_FILE. Defaults to TABLE when omitted.
- added_atint64Output only
The time when this data object is added to the share, in epoch milliseconds.
- added_bystringOutput only
Username of the sharer.
- commentstring
A user-provided comment when adding the data object to the share.
- cdf_enabledboolean
Whether to share the table's change data feed (CDF) with recipients. Requires change data feed to be enabled on the source table, and implicitly enables history sharing. Only applies to tables.
- history_data_sharing_statusstring
Whether to share the table's history, which lets recipients run time travel queries and streaming reads against it. When a TABLE is added without this field or
cdf_enabled, history sharing is ENABLED by default; otherwise the default is DISABLED.DISABLEDENABLED
- start_versionint64
The start version associated with the object. This allows data providers to control the lowest object version that is accessible by clients. If specified, clients can query snapshots or changes for versions >= start_version. If not specified, clients can only query starting from the version of the object at the time it was added to the share.
NOTE: The start_version should be <= the
currentversion of the object.
- statusstring
Sharing status of the data object. ACTIVE means the object is being shared with recipients without issues; PERMISSION_DENIED means the share owner has lost access to the object, so it is not being shared with recipients.
ACTIVEPERMISSION_DENIED
- contentstring
The content of the notebook file when the data object type is NOTEBOOK_FILE. This should be base64 encoded. Required for adding a NOTEBOOK_FILE, optional for updating, ignored for other types.
- partitionsarray of object
Array of partitions for the shared data. Only rows that belong to at least one of the listed partitions are shared. Only applies to tables.
Show child attributesHide child attributes
- valuesarray of object
An array of partition values. A row belongs to the partition when it matches every value in the array, and each
namemust appear at most once in the array.Show child attributesHide child attributes
- namestring
The name of the partition column.
- valuestring
The value of the partition column. When this value is not set, it means
nullvalue. When this field is set, fieldrecipient_property_keycan not be set.
- recipient_property_keystring
The key of a Delta Sharing recipient's property. For example "databricks-account-id". When this field is set, field
valuecan not be set.
- opstring
The operator to apply for the value. EQUAL matches the partition value exactly; LIKE matches it against a SQL
LIKEpattern.EQUALLIKE
- created_atint64Output only
Time at which this share was created, in epoch milliseconds.
- created_bystringOutput only
Username of share creator.
- updated_atint64Output only
Time at which this share was updated, in epoch milliseconds.
- updated_bystringOutput only
Username of share updater.
- storage_locationstringOutput only
Full storage path, derived from
storage_root, where the share's notebook files are stored.
Get a share GA
GET
Gets a data object share from the metastore. The caller must have the USE_SHARE privilege on the metastore or be the owner of the share.
API scopes: sharing
Parameters
- namestringRequiredpath
The name of the share.
Response
Returns the ShareInfo object.
List shares GA
GET
Gets an array of data object shares from the metastore. If the caller has the USE_SHARE privilege on the metastore, all shares are returned. Otherwise, only shares owned by the caller are returned. There is no guarantee of a specific ordering of the elements in the array.
API scopes: sharing
Parameters
- max_resultsint32<= 1000query
Maximum number of shares to return.
- when set to 0, the page length is set to a server configured value (recommended);
- when set to a value greater than 0, the page length is the minimum of this value and a server configured value;
- when set to a value less than 0, an invalid parameter error is returned;
- If not set, all valid shares are returned (not recommended).
- Note: The number of returned shares might be less than the specified max_results size, even zero. The only definitive indication that no further shares can be fetched is when the next_page_token is unset from the response.
- page_tokenstringquery
Opaque pagination token to go to next page based on previous query.
Response
Returns a list of ShareInfo objects.
Create a share GA
POST
Creates a new share for data objects. Data objects can be added after creation with update. The caller must be a metastore admin or have the CREATE_SHARE privilege on the metastore.
API scopes: sharing
Request body
- namestring
Name of the share.
- ownerstring
Username of current owner of share.
- commentstring
User-provided free-form text description.
- storage_rootstring
Cloud storage path, within an external location, under which the share stores the notebook files added to it. When unset, notebook files are stored under the metastore root storage location.
- objectsarray of object
A list of shared data objects within the share.
Show child attributesHide child attributes
- namestringRequired
A fully qualified name that uniquely identifies a data object. For example, a table's fully qualified name is in the format of
<catalog>.<schema>.<table>, a schema's is<catalog>.<schema>, a volume's, model's, or function's is<catalog>.<schema>.<object_name>, and a notebook file's is its workspace path.
- data_object_typestring
The type of the data object. One of TABLE, VIEW, MATERIALIZED_VIEW, STREAMING_TABLE, FOREIGN_TABLE, SCHEMA, VOLUME, MODEL, FUNCTION, FEATURE_SPEC, or NOTEBOOK_FILE. Defaults to TABLE when omitted.
- commentstring
A user-provided comment when adding the data object to the share.
- cdf_enabledboolean
Whether to share the table's change data feed (CDF) with recipients. Requires change data feed to be enabled on the source table, and implicitly enables history sharing. Only applies to tables.
- history_data_sharing_statusstring
Whether to share the table's history, which lets recipients run time travel queries and streaming reads against it. When a TABLE is added without this field or
cdf_enabled, history sharing is ENABLED by default; otherwise the default is DISABLED.DISABLEDENABLED
- start_versionint64
The start version associated with the object. This allows data providers to control the lowest object version that is accessible by clients. If specified, clients can query snapshots or changes for versions >= start_version. If not specified, clients can only query starting from the version of the object at the time it was added to the share.
NOTE: The start_version should be <= the
currentversion of the object.
- statusstring
Sharing status of the data object. ACTIVE means the object is being shared with recipients without issues; PERMISSION_DENIED means the share owner has lost access to the object, so it is not being shared with recipients.
ACTIVEPERMISSION_DENIED
- contentstring
The content of the notebook file when the data object type is NOTEBOOK_FILE. This should be base64 encoded. Required for adding a NOTEBOOK_FILE, optional for updating, ignored for other types.
- partitionsarray of object
Array of partitions for the shared data. Only rows that belong to at least one of the listed partitions are shared. Only applies to tables.
Show child attributesHide child attributes
- valuesarray of object
An array of partition values. A row belongs to the partition when it matches every value in the array, and each
namemust appear at most once in the array.Show child attributesHide child attributes
- namestring
The name of the partition column.
- valuestring
The value of the partition column. When this value is not set, it means
nullvalue. When this field is set, fieldrecipient_property_keycan not be set.
- recipient_property_keystring
The key of a Delta Sharing recipient's property. For example "databricks-account-id". When this field is set, field
valuecan not be set.
- opstring
The operator to apply for the value. EQUAL matches the partition value exactly; LIKE matches it against a SQL
LIKEpattern.EQUALLIKE
Response
Returns the ShareInfo object.
Update a share GA
PATCH
Updates the share with the changes and data objects in the request. The caller must be the owner of the share or a metastore admin.
When the caller is a metastore admin, only the owner field can be updated.
In the case the share name is changed, updateShare requires that the caller is the owner of the share and has the CREATE_SHARE privilege.
If there are notebook files in the share, the storage_root field cannot be updated.
For each table that is added through this method, the share owner must also have SELECT privilege on the table. This privilege must be maintained indefinitely for recipients to be able to access the table. Typically, you should use a group as the share owner.
Table removals through update do not require additional privileges.
API scopes: sharing
Parameters
- name_argstringRequiredpath
The name of the share.
Request body
- new_namestring
New name for the share.
- updatesarray of object
Array of shared data object updates. The server limits how many updates a single request can contain.
Show child attributesHide child attributes
- actionstring
One of: ADD, REMOVE, UPDATE. ADD adds the data object to the share, REMOVE removes it, and UPDATE changes the properties of a data object that is already in the share.
ADDREMOVEUPDATE
- data_objectobject
The data object that is being added, removed, or updated.
Show child attributesHide child attributes
- namestringRequired
A fully qualified name that uniquely identifies a data object. For example, a table's fully qualified name is in the format of
<catalog>.<schema>.<table>, a schema's is<catalog>.<schema>, a volume's, model's, or function's is<catalog>.<schema>.<object_name>, and a notebook file's is its workspace path.
- data_object_typestring
The type of the data object. One of TABLE, VIEW, MATERIALIZED_VIEW, STREAMING_TABLE, FOREIGN_TABLE, SCHEMA, VOLUME, MODEL, FUNCTION, FEATURE_SPEC, or NOTEBOOK_FILE. Defaults to TABLE when omitted.
- commentstring
A user-provided comment when adding the data object to the share.
- cdf_enabledboolean
Whether to share the table's change data feed (CDF) with recipients. Requires change data feed to be enabled on the source table, and implicitly enables history sharing. Only applies to tables.
- history_data_sharing_statusstring
Whether to share the table's history, which lets recipients run time travel queries and streaming reads against it. When a TABLE is added without this field or
cdf_enabled, history sharing is ENABLED by default; otherwise the default is DISABLED.DISABLEDENABLED
- start_versionint64
The start version associated with the object. This allows data providers to control the lowest object version that is accessible by clients. If specified, clients can query snapshots or changes for versions >= start_version. If not specified, clients can only query starting from the version of the object at the time it was added to the share.
NOTE: The start_version should be <= the
currentversion of the object.
- statusstring
Sharing status of the data object. ACTIVE means the object is being shared with recipients without issues; PERMISSION_DENIED means the share owner has lost access to the object, so it is not being shared with recipients.
ACTIVEPERMISSION_DENIED
- contentstring
The content of the notebook file when the data object type is NOTEBOOK_FILE. This should be base64 encoded. Required for adding a NOTEBOOK_FILE, optional for updating, ignored for other types.
- partitionsarray of object
Array of partitions for the shared data. Only rows that belong to at least one of the listed partitions are shared. Only applies to tables.
Show child attributesHide child attributes
- valuesarray of object
An array of partition values. A row belongs to the partition when it matches every value in the array, and each
namemust appear at most once in the array.Show child attributesHide child attributes
- namestring
The name of the partition column.
- valuestring
The value of the partition column. When this value is not set, it means
nullvalue. When this field is set, fieldrecipient_property_keycan not be set.
- recipient_property_keystring
The key of a Delta Sharing recipient's property. For example "databricks-account-id". When this field is set, field
valuecan not be set.
- opstring
The operator to apply for the value. EQUAL matches the partition value exactly; LIKE matches it against a SQL
LIKEpattern.EQUALLIKE
- namestring
Name of the share.
- ownerstring
Username of current owner of share.
- commentstring
User-provided free-form text description.
- storage_rootstring
Cloud storage path, within an external location, under which the share stores the notebook files added to it. When unset, notebook files are stored under the metastore root storage location.
- objectsarray of object
A list of shared data objects within the share.
Show child attributesHide child attributes
- namestringRequired
A fully qualified name that uniquely identifies a data object. For example, a table's fully qualified name is in the format of
<catalog>.<schema>.<table>, a schema's is<catalog>.<schema>, a volume's, model's, or function's is<catalog>.<schema>.<object_name>, and a notebook file's is its workspace path.
- data_object_typestring
The type of the data object. One of TABLE, VIEW, MATERIALIZED_VIEW, STREAMING_TABLE, FOREIGN_TABLE, SCHEMA, VOLUME, MODEL, FUNCTION, FEATURE_SPEC, or NOTEBOOK_FILE. Defaults to TABLE when omitted.
- commentstring
A user-provided comment when adding the data object to the share.
- cdf_enabledboolean
Whether to share the table's change data feed (CDF) with recipients. Requires change data feed to be enabled on the source table, and implicitly enables history sharing. Only applies to tables.
- history_data_sharing_statusstring
Whether to share the table's history, which lets recipients run time travel queries and streaming reads against it. When a TABLE is added without this field or
cdf_enabled, history sharing is ENABLED by default; otherwise the default is DISABLED.DISABLEDENABLED
- start_versionint64
The start version associated with the object. This allows data providers to control the lowest object version that is accessible by clients. If specified, clients can query snapshots or changes for versions >= start_version. If not specified, clients can only query starting from the version of the object at the time it was added to the share.
NOTE: The start_version should be <= the
currentversion of the object.
- statusstring
Sharing status of the data object. ACTIVE means the object is being shared with recipients without issues; PERMISSION_DENIED means the share owner has lost access to the object, so it is not being shared with recipients.
ACTIVEPERMISSION_DENIED
- contentstring
The content of the notebook file when the data object type is NOTEBOOK_FILE. This should be base64 encoded. Required for adding a NOTEBOOK_FILE, optional for updating, ignored for other types.
- partitionsarray of object
Array of partitions for the shared data. Only rows that belong to at least one of the listed partitions are shared. Only applies to tables.
Show child attributesHide child attributes
- valuesarray of object
An array of partition values. A row belongs to the partition when it matches every value in the array, and each
namemust appear at most once in the array.Show child attributesHide child attributes
- namestring
The name of the partition column.
- valuestring
The value of the partition column. When this value is not set, it means
nullvalue. When this field is set, fieldrecipient_property_keycan not be set.
- recipient_property_keystring
The key of a Delta Sharing recipient's property. For example "databricks-account-id". When this field is set, field
valuecan not be set.
- opstring
The operator to apply for the value. EQUAL matches the partition value exactly; LIKE matches it against a SQL
LIKEpattern.EQUALLIKE
Response
Returns the ShareInfo object.