Hi, assuming you have a dictionary with column name to comment mapping, you can do this using pyspark like this:
columns_comments = {
"col1": "comment1",
"col2": "comment2",
# Add all your columns and comments here
}
for col, comment in columns_comments.items():
spark.sql(f"ALTER TABLE your_table_name CHANGE COLUMN {col} SET COMMENT '{comment}'")