title: dataframe into dense vector spark
body: <p>Acyally am working on spark 2.0.2
  I would like to know , for example to work on logistic regression based on Spark ML.I would like to get each row of the dataframe into a vector which will be input for logistic regression , can you help get row resulted in the dataframe to get each row into a dense vector .Thanks.Here what i did to get the dataframe.</p>
  
  <pre><code>import org.apache.spark.ml.classification.LogisticRegression
  import org.apache.spark.ml.linalg.{Vector, Vectors}
  import org.apache.spark.ml.param.ParamMap
  import org.apache.spark.sql.SparkSession
  import org.apache.spark.sql.Row
  import org.apache.hadoop.fs.shell.Display
  
  object Example extends App {
  val sparkSession = SparkSession.builder.master("local").appName("my-spark-app").getOrCreate()
  val data=sparkSession.read.option("header", "true").csv("C://sample_lda_data.csv").toDF()
  val data2=data.select("col2","col3","col4","col5","col6","col7","col8","col9")
  </code></pre>
  
  <p>at the end i want to get something like this as input for logistic regression
  in the first position it will be the first column of the dataframe any help please </p>
  
  <pre><code>val data=sparkSession.read.option("header", "true").csv("C://sample_lda_data.csv").toDF()
  val data2=data.select("col2","col3","col4","col5","col6","col7","col8","col9")
  val assembler = new VectorAssembler().setInputCols(Array("col2", "col3", "col4")).setOutputCol("features")
  val output = assembler.transform(data2)
  
  main" java.lang.IllegalArgumentException: Data type StringType is not supported.
  </code></pre>
  
  <p>I'll be so gratefull.Thank you guys</p>