I am not able to convert string to date format in spark.sql. When I am passing the raw string , it is converted successfully but when I am trying to store that value in a variab