title: Aggregating arrays element wise
body: <p>Pretty new to spark/scala.   I am wondering if there is an easy way to aggregate an Array[Double] in a column-wise fashion.  Here is an example:</p>
  
  <pre><code>c1   c2   c3
  -------------------------
  1     1   [1.0, 1.0, 3.4]
  1     2   [1.0, 0,0, 4.3]
  2     1   [0.0, 0.0, 0.0]
  2     3   [1.2, 1.1, 1.1]
  </code></pre>
  
  <p>Then, upon aggregation,  I would end with a table that looks like:</p>
  
  <pre><code>c1   c3prime
  -------------
  1     [2.0, 1.0, 7.7]
  2     [1.2, 1.1, 1.1]
  </code></pre>
  
  <p>Looking at UDAF now, but was wondering if I need to code at all?</p>
  
  <p>Thanks for your consideration.</p>