Apply unitycatalog tags programmatically

afisl
New Contributor II

Hello,

I'm interested in the "Tags" feature of columns/schemas/tables of the UnityCatalog (described here: https://learn.microsoft.com/en-us/azure/databricks/data-governance/unity-catalog/tags)

I've been able to play with them by hand and would now like to integrate them from a programmatic perspective. I was able to QUERY them programmatically (described here https://learn.microsoft.com/en-us/azure/databricks/sql/language-manual/information-schema/column_tag... but not SET/UPDATE them programmatically.

I think it should be possible to set them programmatically according to the following paragraph in the documentation:

Currently, Azure Databricks supports tagging SQL commands with catalogs, schemas, tables (views, materialized views, streaming tables), and table columns. Learn more about the Databricks SQL tag commands at SQL language reference.

Source: https://learn.microsoft.com/en-us/azure/databricks/data-governance/unity-catalog/tags#manage-tags-wi...

I've tried UPDATE statement on the information_schema.column_tags table, but get an spark error message:

SparkUnsupportedOperationException: UPDATE TABLE is not supported temporarily.

Any idea how I can set tags programmatically?

Thanks for your support,

Best

Antoine