sparkbyexamples.com
Spark - How to Change Column Type?
To change the Spark SQL DataFrame column type from one data type to another data type you should use cast() function of Column class, you can use this on
Naveen Nelamali