I have a dataframe df of columns (\"id\", \"current_date\", \"days\") and I am trying to add the the \"days\" to \"
dataframe
columns
(\"id\", \"current_date\", \"days\")
days
No need to use an UDF, you can do it using an SQL expression:
val newDF = df.withColumn("new_date", expr("date_add(current_date,days)"))