Programmatically setting TAGs on VIEWs

stefan_erste
New Contributor III

Hi all,

In order to achieve data stability in our Workspace, our IT team has given us access to the data through VIEWs on top of an ingestion schema.

Now I want to provide metadata to VIEWs in form of TAGs (IT does not want to cover this used case). They are stored in a table and I planned to do a loop and dynamically create SQL statements. I have confirmed the SQL syntax as

SET TAG ON COLUMN
catalog_name.schema_name.table_name.colum_name `tag_key` = `tag_value`;
by running it in the SQL editor.
 
However, it does not work in a notebook using pyspark, but rather returns the following error:
"[INVALID_PROPERTY_KEY] "TAG ON COLUMN prod_aut_crp00_lab_catalog.access_uc045_crisp_db.prod_parsed_crisp_crrp_vw_fct_deal_sas.CD_AGG_UAMRT_MDF_EST_LCOA `reporting_field_name`" is an invalid property key, please use quotes, e.g. SET "TAG ON COLUMN prod_aut_crp00_lab_catalog.access_uc045_crisp_db.prod_parsed_crisp_crrp_vw_fct_deal_sas.CD_AGG_UAMRT_MDF_EST_LCOA `reporting_field_name`"="DCO - Aggregated Unamortized Contractual Modifications and Changes in Estimates Local GAAP LCOA". SQLSTATE: 42602".
 
I tried adjusting per suggestion but again it fails saying that quotes after set are incorrect syntax (which is logical).
 
Any help is appreciated!
Stefan