title: Spark finding gaps in timestamps
body: <p>I have a Pair RDD, that consists of (Key, (Timestamp,Value)) entries.</p>
  
  <p>When reading the data, the entries are sorted by the timestamp, so each partition of the RDD should be ordered by the timestamp. What I want to do is, find for every key, the biggest gap between 2 sequential timestamps. </p>
  
  <p>I'm thinking about this problem for a long time now, and I don't see how that could be realized given the functions sparks provide. The problems I see are: I loose the order information when I do a simple map, so that is not a possibility. It also seems to me that a groupByKey fails because there are too many entries for a specific key, Trying to do that gives me a <code>java.io.IOException: No space left on device</code></p>
  
  <p>Any help about how to approach this would be immensely helpful.</p>