TABLE_TAGS

Applies to: check marked yes Databricks SQL check marked yes Databricks Runtime 13.3 LTS and above check marked yes Unity Catalog only.

INFORMATION_SCHEMA.TABLE_TAGS contains the table tagging metadata within the table, or all tables if owned by the SYSTEM catalog. Also contains tagging metadata for views and materialized views.

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

This relation is an extension to the SQL Standard Information Schema.

Definition

The TABLE_TAGS relation contains the following.

Name

Data type

Nullable

Description

CATALOG_NAME

STRING

No

The catalog name that a given tag applies to.

SCHEMA_NAME

STRING

No

The schema that the tag applies to.

TABLE_NAME

STRING

No

The table, view, or materialized view that the tag applies to.

TAG_NAME

STRING

No

The name of the tag.

TAG_VALUE

STRING

No

The value of the tag.

Constraints

The following constraint applies to the TABLE_TAGS relation:

Class

Name

Column List

Description

Primary key

TABLE_TAGS_PK

CATALOG_NAME, SCHEMA_NAME, TABLE_TAG, TAG_NAME, TAG_VALUE

Unique identifier for a table tag.

Foreign key

TABLE_TAGS_SCHEMATA_FK

CATALOG_NAME, SCHEMA_NAME

References SCHEMATA

Foreign key

TABLE_TAGS_TABLES_FK

CATALOG_NAME, SCHEMA_NAME, TABLE_NAME

References TABLES

Foreign key

TABLE_TAGS_CATALOGS_FK

CATALOG_NAME

References CATALOGS

Example

> SELECT catalog_name, schema_name, table_name, tag_name, tag_value
    FROM information_schema.table_tags;