score:2

Accepted answer

you can use either of the two:

employeedf.na.fill(1000, seq("commission")).show()


import org.apache.spark.sql.functions._
employeedf.withcolumn("commission", when(col("commission").isnull, 1000) otherwise col("commission")).show()

Related Query

More Query from same tag