We recently upgraded Spark from v.2.1 to v.2.4
The code which was working previously is as below:
final_df = spark.sql(&quo