title: How to efficiently join 2 DateFrames based on Timestamp difference?
body: <p>I have two DataFrames with two different time-series data. For simplicity let's call them <code>Events</code> and <code>Status</code>.</p>
  
  <pre><code>events:
  root
   |-- timestamp: timestamp (nullable = true)
   |-- event_type: string (nullable = true)
   |-- event_id: string (nullable = true)
  
  statuses:
  root
   |-- timestamp: timestamp (nullable = true)
   |-- status: string (nullable = true)
   |-- field1: string (nullable = true)
   |-- field2: string (nullable = true)
   |-- field3: string (nullable = true)
  </code></pre>
  
  <p>I'd like to join them so every <code>Event</code> will have a column of <code>list_statuses</code> that contains all <code>Row</code> objects of statuses in the previous X hours of its own timestamp.</p>
  
  <p>I can do it by a cartesian product of <code>events</code> and <code>statuses</code> and then <code>filter</code> for the time criteria but that it (extremely) inefficient. </p>
  
  <p>Is there any better way to do it? Anything off-the-shelf?</p>
  
  <p>(I thought to group both dataframes on a time-window, then self-join the second to contain both the current and the previous time-windows and then join between them and filter, but if there is anything ready and bug-free,  I'd happily use...)</p>
  
  <p>Thanks!</p>