Skip to main content

TABLE_SHARE_USAGE

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 10.4 LTS and above

INFORMATION_SCHEMA.TABLE_SHARE_USAGE lists tables which belong to shares.

Information is displayed only for shares the user has permission to interact with.

This is an extension to the SQL Standard Information Schema.

Definition

The TABLE_SHARE_USAGE relation contains the following columns:

NameData typeNullableDescription
CATALOG_NAMESTRINGNoCatalog of the table in the share.
SCHEMA_NAMESTRINGNoSchema of the table in the share.
TABLE_NAMESTRINGNoTable in the share.
SHARE_NAMESTRINGNoName of the share.
PARTITION_SPECSTRINGYesPartition filtering specification for the shared table.
CDF_ENABLEDSTRINGNoWhether CDF is enabled on the shared table.
START_VERSIONLONGNoThe start version associated with the shared table.
SHARED_AS_SCHEMASTRINGNoAlias of the shared schema.
SHARED_AS_TABLESTRINGNoAlias of the shared table.
COMMENTSTRINGYesAn optional comment that describes the table share usage.

Constraints

The following constraints apply to the TABLE_SHARE_USAGE relation:

ClassNameColumn ListDescription
Primary keyTABLE_SHARE_USAGE_PKSHARE_NAME, SHARED_AS_SCHEMA, SHARED_AS_TABLEUnique identifier for the table share usage.
Foreign keyTABLE_SHARE_USAGE_TABLES_FKCATALOG_NAME, SCHEMA_NAME, TABLE_NAMEReferences TABLES
Foreign keyTABLE_SHARE_USAGE_SHARES_FKSHARE_NAMEReferences SHARES

Examples

SQL
> SELECT share_name, catalog_name, schema_name, table_name
FROM information_schema.table_share_usage;