Apply tags
This article shows how to apply tags in Unity Catalog.
Tags are attributes containing keys and optional values that you can apply to different securable objects in Unity Catalog. Tagging is useful for organizing and categorizing different securable objects within a metastore. Using tags also simplifies search and discovery of your data assets.
Supported securable objects
Securable object tagging is currently supported on catalogs, schemas, tables, volumes, views, and registered models. For more information on securable objects, see Securable objects in Unity Catalog.
Requirements
To add tags to Unity Catalog securable objects, you must have the APPLY TAG
privilege on the object, as well as the USE SCHEMA
privilege on the object’s parent schema and the USE CATALOG
privilege on the object’s parent catalog.
Constraints
The following is a list of tag constraints:
You can assign a maximum of 20 tags to a single securable object.
The maximum length of a tag is 255 characters.
Special characters cannot be used in tag names.
Searching Unity Catalog tables by tag name or value is supported with the exact match only.
Manage tags in Catalog Explorer
To manage securable object tags using the Catalog Explorer UI you must have at least the BROWSE
privilege on the object.
Click Catalog in the sidebar.
Select a securable object to view the tag information.
Click Add/Edit Tags to manage tags for the current securable object. You can add and remove multiple tags simultaneously in the tag management modal.
Retrieve tag information with Information Schema tables
Each catalog created on Unity Catalog includes an INFORMATION_SCHEMA
. This schema includes tables describing the objects known to the schema’s catalog. You must have the appropriate privileges to view the schema information.
You can query the following to retrieve tag information:
For more information, see Information schema.
Manage tags with SQL commands
Note
This feature is only available for Databricks Runtime versions of 13.3 and above.
Databricks supports tagging SQL commands with catalogs, schemas, tables (views, materialized views, streaming tables), volumes, and table columns. For example, you can use the SET TAGS
and UNSET TAGS
clauses with the ALTER TABLE
command to manage tags on a table. See DDL statements for a list of available Data Definition Language (DDL) commands and their syntax.
Use tags to search and filter tables
To search and filter tables using tags:
Click the Search field in the top bar of the Databricks workspace or use the keyboard shortcut Command-P.
Enter your search criteria. Search for tables in Unity Catalog by entering the assigned tag name or value.
You can also use the tag filter in the Table search tab to filter search results with existing tag names.