title: Pyspark euclidean distance between entry and column
body: <p>I am working with pyspark, and wondering if there is any smart way to get euclidean dstance between one row entry of array and the whole column. For instance, there is a dataset like this.</p>
  
  <pre><code>+--------------------+---+
  |            features| id|
  +--------------------+---+
  |[0,1,2,3,4,5     ...|  0|
  |[0,1,2,3,4,5     ...|  1|
  |[1,2,3,6,7,8     ...|  2|
  </code></pre>
  
  <p>Choose one of the column i.e. id==1, and calculate the euclidean distance. In this case, the result should be [0,0,sqrt(1+1+1+9+9+9)].
  Can anybody figure out how to do this efficiently?
  Thanks!</p>