One can change data type of a column by using cast in spark sql.table name is table and it has two columns only column1 and column2 and column1 data type is to be changed.ex-spark.sql("select cast(column1 as Double) column1NewName,column2 from table")In the place of double write your data type.
↧