title: put value from one row to another scala dataaframe
body: <p>I have one large dataframe with 222 columns I want to do like the following example</p>
  
  <pre><code>   |id        |day          |col1   |col2 | col3 ....................
  +----------+----------------+-------+-----+
  |       329|               0|   null|2.0
  |       329|              42|   null|null
  |       329|              72|   5.55|null
  |       329|             106|   null|null
  |       329|             135|   null|3.0
  |       329|             168|   null|4.0
  |       329|             189|  4.995|null
  |       329|             212|   null|6.0
  |       329|             247|   null|null
  |       329|             274|   null|8.0
  
  
  
  |id        |     day        |col1   |col2 |.......................
  +----------+----------------+-------+-----+
  |       329|               0|   null|2.0
  |       329|              42|   null|2.0
  |       329|              72|   5.55|2.0
  |       329|             106|   5.55|2.0
  |       329|             135|   5.55|3.0
  |       329|             168|   5.55|4.0
  |       329|             189|  4.995|4.0
  |       329|             212|  4.995|6.0
  |       329|             247|  4.995|6.0
  |       329|             274|  4.995|8.0
  .
  .
  .
  .
  .
  </code></pre>
  
  <p>1.read row 1 
  2.i have 85k unique id's and for each id have 10 results(shown example of only one ID )
  3.if in the row 2 data is not present the take it from ID's previous row</p>
  
  <p>i got result like this </p>
  
  <pre><code>id         |    day         |original_col1 |Result_col1|prevValue|
  +----------+----------------+--------------+-----------+---------+
  |       329|               0|   null       |   null    |     null|
  |       329|              42|   null       |   null    |     null|
  |       329|              72|   5.55       |   5.55    |     null|
  |       329|             106|   null       |   5.55    |     5.55|
  |       329|             135|   null       |   null    |     null|
  |       329|             168|   null       |   null    |     null|
  |       329|             189|   4.995      |  4.995    |     null|
  |       329|             212|   null       |  4.995    |    4.995|
  |       330|....................................................
  |       330|.....................................................
           .
  </code></pre>