I am relatively new to Spark and Scala.
I am starting with the following dataframe (single column made out of a dense Vector of Doubles):
scala> v
EDIT: use more sophisticated way to interpret fields in Row.
This is worked for me
val featureVectors = features.map(row => { Vectors.dense(row.toSeq.toArray.map({ case s: String => s.toDouble case l: Long => l.toDouble case _ => 0.0 })) })
features is a DataFrame of spark SQL.