Working on a Spark Dataframe where I want to adjust the content of a field. Input for the adjustment comes from a list, however, when I pass the information in the list as arguments I get an error:
AssertionError: col should be Column
fld = ["As_Of_Date","date_format('As_Of_Date,'yyyyMMdd')"]
df.withColumn(fld[0],fld[1])
if I pass it directly without the list, it does work. What am I doing wrong and what should I change to make it work?