I can collect a column like this using the RDD API.
df.map(r => r.getAs[String]("column")).collect
However, as I am initially using a Dataset I rather would like to not switch the API level. A simple df.select("column).collect
returns an Array[Row]
where the .flatten
operator no longer works.
How can I collect to Array[T e.g. String]
directly?