I am new to Spark and this might be a straightforward problem. I’ve a SQL with name sql_left which is in the format: Here is a sample data generated using sql_left.take(1): Note: Age column has ‘XXX’,’NUll’ and other integer values as 023,034 etc. The printSchema shows Age,Total Cas as integers. I’ve tried the below code to first join two tables: