title: Spark window function filtering rows which doesn't match requirement
body: <p>what I wish to do is to get the max of two row's window. and delete last rows because it only calculate one row.</p>
  <p>for example, the below is source data</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>seconds</th>
  <th>value</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>225</td>
  <td>1.5</td>
  </tr>
  <tr>
  <td>245</td>
  <td>0.5</td>
  </tr>
  <tr>
  <td>300</td>
  <td>2.4</td>
  </tr>
  <tr>
  <td>319</td>
  <td>1.2</td>
  </tr>
  <tr>
  <td>320</td>
  <td>4.6</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>and the table below is what I wanted. it drop 320 seconds because it's the latest one and it's only has its own.</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>seconds</th>
  <th>max</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>225</td>
  <td>1.5</td>
  </tr>
  <tr>
  <td>245</td>
  <td>2.4</td>
  </tr>
  <tr>
  <td>300</td>
  <td>2.4</td>
  </tr>
  <tr>
  <td>319</td>
  <td>4.6</td>
  </tr>
  </tbody>
  </table>
  </div>