title: spark collect as Array[T] and not as Array[Row] from data frame
body: <p>I can collect a column like this using the RDD API. </p>
  
  <pre><code>df.map(r =&gt; r.getAs[String]("column")).collect
  </code></pre>
  
  <p>However, as I am initially using a Dataset I rather would like to not switch the API level. A simple <code>df.select("column).collect</code> returns an <code>Array[Row]</code> where the <code>.flatten</code> operator no longer works.
  How can I collect to <code>Array[T e.g. String]</code> directly?</p>