szymon_dybczak
Esteemed Contributor III

Hi @stefan_erste ,

Ok, so in my case I was able to set tag in pyspark using following way:

spark.sql(f"""
    SET TAG ON COLUMN default.employees.Id test_tag = test_value
""")

Of course you can do it dynamically using loop and f-string:

tags = [
    "my_tag3 = my_tag_value",
    "my_tag4 = my_tag_other_value"
]
for tag in tags:
    query_template = f"SET TAG ON COLUMN default.employees.Id {tag}"
    #print(query_template)
    spark.sql(query_template)