0

This is my input DataFrame:

number|word|ID |Name|
+------+----+---+----+
|1     |    |   |    |
|      |abc |   |    |
|      |    |103|    |
|      |    |   |Dev |
+------+----+---+----

I want to remove the blank values and want to merge all the rows into single row like this:

number|word|ID |Name|
+------+----+---+----+
|1     | abc|103| Dev  

First of all is it possible in spark? If yes then what is the best way to achieve. I am using Scala and Spark 2.1. Also, I can have n no.of columns.

Naman Agarwal
  • 614
  • 1
  • 8
  • 28

0 Answers0