I am currently working with a spark dataframe having 7 columns and one column being date . In my case the date column is represented as Quarters i.e 2017Q1 , 2017Q2,2017Q3
How do i create 2 new columns as below
Date_String
Replace 2017Q1 with string "January - March 2017" and
replace 2017Q2 with string "April -June 2017
I tried the below command
df= df.withColumn("Date_String",where(col("quarter_date") == "2017Q4"),lit('October - December 2017'))
Can anyone please help me on the above