cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

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
"""



 

1 ACCEPTED SOLUTION

Accepted Solutions

WiliamRosa
New 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

3 REPLIES 3

WiliamRosa
New 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

b-baran
New Contributor III

Thank you very much for response William

WiliamRosa
New 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