title: How to convert Array[Long] to Vector type in scala dataframe?
body: <p>I have dataframe like this:</p>
  
  <pre><code>+------+-----+-------------------+--------------------+
  |    Id|Label|          Timestamp|         Signal_list|
  +------+-----+-------------------+--------------------+
  |A05439|    1|2014-05-20 05:05:21|[-116, -123, -129...|
  |A06392|    1|2013-12-27 04:12:33|[260, 314, 370, 4...|
  |A08192|    1|2014-06-03 04:06:15|[334, 465, 628, 8...|
  |A08219|    3|2013-12-31 03:12:41|[-114, -140, -157...|
  |A02894|    2|2013-10-28 06:10:53|[109, 139, 170, 1...|
  </code></pre>
  
  <p>This dataframe signal list have 9k elements, I want to convert the signal list column into vector. I tried the below UDF :</p>
  
  <pre><code>import org.apache.spark.ml.linalg._
  
  val convertUDF = udf((array : Seq[Long]) =&gt; {
    Vectors.dense(array.toArray)
  })
  val afWithVector = afLabel.select("*").withColumn("Signal_list", convertUDF($"Signal_list"))
  </code></pre>
  
  <p>But it gives error:</p>
  
  <pre><code>console&gt;:39: error: overloaded method value dense with alternatives:
    (values: Array[Double])org.apache.spark.ml.linalg.Vector &lt;and&gt;
    (firstValue: Double,otherValues: Double*)org.apache.spark.ml.linalg.Vector
   cannot be applied to (Array[Long])
           Vectors.dense(array.toArray)
  </code></pre>
  
  <p>Dataframe schema:</p>
  
  <pre><code>|-- Id: string (nullable = true)
   |-- Label: integer (nullable = true)
   |-- Timestamp: string (nullable = true)
   |-- Signal_list: array (nullable = true)
   |    |-- element: long (containsNull = true)
  </code></pre>
  
  <p>I'm new at using scala, an answer using pyspark will be more helpful.</p>