How to flatten (or explode) the data along with row in a Dataframe, based on column data?
How to flatten (or explode) the data along with row in a Dataframe, based on column data? Data frame should explode based on SPC column. Below is example My Input DataFrame. ID Name Level SPC Rating salry 23 sam 3 HBS 3.5 4000 43 Nair 4 KSTk 4 5000 56 Rom 5 MNC 3 3000 My output should be: ID Name level SPC Rating Salary 23 sam 3 H 3.5 4000 23 sam 3 B 3.5 4000 23 sam 3 S 3.5 4000 43 Nair 4 K 4 5000 43 Nair 4 S 4 5000 43 Nair 4 T 4 5000 43 Nair 4 k 4 5000 How can I resolve this problem in Scala or Java code? 2 Answers 2 If you have a dataframe/dataset as +---+----+-----+----+------+------+ |ID |Name|Level|SPC |Rating|salary| +---+----+---...