title: Explode array data into rows in spark
body: <p>I have a dataset in the following way:</p>
  
  <pre><code>FieldA    FieldB    ArrayField
  1         A         {1,2,3}
  2         B         {3,5}
  </code></pre>
  
  <p>I would like to explode the data on <em>ArrayField</em> so the output will look in the following way:</p>
  
  <pre><code>FieldA    FieldB    ExplodedField
  1         A         1
  1         A         2
  1         A         3
  2         B         3
  2         B         5
  </code></pre>
  
  <p>I mean I want to generate an output line for each item in the array the in <em>ArrayField</em> while keeping the values of the other fields.</p>
  
  <p>How would you implement it in Spark.
  Notice that the input dataset is very large.</p>