title: How to filter a spark dataframe based on occurrence of a value in a column with a condition a date column?
body: <p>team, I'm working with a dataframe looks like:</p>
  
  <pre><code>    df
      client   | date   
        C1     |08-NOV-18 11.29.43
        C2     |09-NOV-18 13.29.43
        C2     |09-NOV-18 18.29.43
        C3     |11-NOV-18 19.29.43
        C1     |12-NOV-18 10.29.43
        C2     |13-NOV-18 09.29.43
        C4     |14-NOV-18 20.29.43
        C1     |15-NOV-18 11.29.43
        C5     |16-NOV-18 15.29.43
        C10    |17-NOV-18 19.29.43
        C1     |18-NOV-18 12.29.43
        C2     |18-NOV-18 10.29.43
        C2     |19-NOV-18 09.29.43
        C6     |20-NOV-18 13.29.43
        C6     |21-NOV-18 14.29.43
        C1     |21-NOV-18 18.29.43
        C1     |22-NOV-18 11.29.43
  </code></pre>
  
  <p>My goal is to filter this dataframe and get new dataframe that contains tow last occurrence of each client if this occurrence is &lt; of 24 hours for example for this example the result must be:</p>
  
  <pre><code>     client  |date
        C2     |18-NOV-18 10.29.43
        C2     |19-NOV-18 09.29.43
        C1     |21-NOV-18 18.29.43
        C1     |22-NOV-18 11.29.43
  </code></pre>
  
  <p>any help, please !</p>