I am currently working with a dataframe right now in scala, and can't figure out how to fill a column with a Seq.empty[Row]
value if the value in that row is null
. I understand there is the df.na.fill
function, however it seems to only handle strings, doubles, or ints from my understanding.
Essentially, I want to be able to fill the null row with a Seq.empty[Row]
, for a nested field. I'm sure this is possible, however it seems like I can't find anything like it online.
Table example --
+-----------+-------------------+-----------+---------+------------------+
| field| field2| | values|
+-----------+-------------------+-----------+----------+------------------+
| stuff2| stuff 2| | null |
| stuff1| stuff1| | [val 1,val2,..]|
+-----------+-------------------+-----------+----------+------------------+
Essentially, I want that null to turn into an empty array like so: []
. Any help would be appreciated, thank you.