Hi,
In Spark, fill() function of DataFrameNaFunctions class is used to replace NULL values on the DataFrame column with either zero(0), empty string, space, or any constant literal values.
//Replace all integer and long columns
df.na.fill(0)
.show(false)
//Replace with specific columns
df.na.fill(0,Array("population"))
.show(false)