I am new to Spark and Scala.
I have created a DataFrame
from a csv in Spark.
There is a column in the generated DataFrame
which has a null value for some rows.
I want to check for this null value and replace it with a constant word say "Hello".
How can I do this in Spark?
Here is my sample code to create a dataframe from csv.
val DFCsv = spark.read.format("csv") .option("sep", ',') .option("inferSchema", "true") .option("header", "true") .load("/tmp/my.csv")
DFCsv.show()
Now one of the columns in that dataframe named "id" is null or empty/blank for some of the rows.
How can I iterate over each row one by one and then fill out column named "id" with a constant "Hello" String.