SyntaxFix
Write A Post
Hire A Developer
Questions
You can use below code.
df.withColumn("year", df("year").cast(IntegerType))
Which will convert year column to IntegerType column.
IntegerType