title: Manipulating Vectors and Lists in RDDs
body: <p>I'm new to Spark and Scala and I really need some help with the following RDD transformation:</p>
  
  <p><strong>INPUT</strong>
  (macAddress,Vector(List(ts1,ts2),List(ts2,ts3),List.....)</p>
  
  <p><code>(c8:3a:bv:b1:3a:e0,Vector(List(1472820071, 1472821088), List(1472821088, 1472821429), List(1472821429, 1472824217)))</code></p>
  
  <p><strong>DESIDED OUTPUT</strong> (macAddress,Vector(intvalue,intvalue,...))</p>
  
  <p><code>(c8:3a:bv:b1:3a:e0,Vector(1472821088-1472820071, 1472821429-1472821088,1472824217-1472821429))</code></p>
  
  <p>In short, I have an rdd already grouped by key (macAddress) containing Paired Lists of values. I need to transform the Vector of Lists into a Vector containing the paired differences computed from the Lists (secondElement-firstElement). The number of paired Lists in Vector is variable in RDD (depends from the macAddress considered)</p>
  
  <p>I don't know which transformation I have to use in this case. </p>
  
  <p>Thanks </p>