You can use below code.
df.withColumn("year", df("year").cast(IntegerType))
Which will convert year column to IntegerType
column.
You can use below code.
df.withColumn("year", df("year").cast(IntegerType))
Which will convert year column to IntegerType
column.