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:

Name

Data type

Nullable

Description

CATALOG_NAME

STRING

No

Catalog of the table in the share.

SCHEMA_NAME

STRING

No

Schema of the table in the share.

TABLE_NAME

STRING

No

Table in the share.

SHARE_NAME

STRING

No

Name of the share.

PARTITION_SPEC

STRING

Yes

Partition filtering specification for the shared table.

CDF_ENABLED

STRING

No

Whether CDF is enabled on the shared table.

START_VERSION

LONG

No

The start version associated with the shared table.

SHARED_AS_SCHEMA

STRING

No

Alias of the shared schema.

SHARED_AS_TABLE

STRING

No

Alias of the shared table.

COMMENT

STRING

Yes

An optional comment that describes the table share usage.

Constraints

The following constraints apply to the TABLE_SHARE_USAGE relation:

Class

Name

Column List

Description

Primary key

TABLE_SHARE_USAGE_PK

SHARE_NAME, SHARED_AS_SCHEMA, SHARED_AS_TABLE

Unique identifier for the table share usage.

Foreign key

TABLE_SHARE_USAGE_TABLES_FK

CATALOG_NAME, SCHEMA_NAME, TABLE_NAME

References TABLES

Foreign key

TABLE_SHARE_USAGE_SHARES_FK

SHARE_NAME

References SHARES

Examples

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