How to define a column tag in a table schema definition?

b-baran
New Contributor III

Setting a tag for a specific column can be done using the SQL command:
https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-ddl-set-tag

Is there another possible way to define a column tag?

For example, it is possible to add a column comment and masking function as below via the schema definition.

schema = """
Primary_Key BIGINT COMMENT "Primary Key",
Masked_Value STRING COMMENT "Masked Value" MASK catalog.schema.mask_function
"""



 

WiliamRosa
Honored Contributor III

Hi @b-baran,
I couldn’t find any alternative in the official documentation — currently, the only supported way to define column tags is using ALTER TABLE ... ALTER COLUMN ... SET TAGS.

Wiliam Rosa
Data Engineer | Machine Learning Engineer
LinkedIn: linkedin.com/in/wiliamrosa

View solution in original post

b-baran
New Contributor III

Thank you very much for response William

WiliamRosa
Honored Contributor III

You’re welcome @b-baran ! If you feel my answer addressed your question, could you please mark it as the solution to the post? Thank you very much!

Wiliam Rosa
Data Engineer | Machine Learning Engineer
LinkedIn: linkedin.com/in/wiliamrosa