title: How to extract a value from a Vector in a column of a Spark Dataframe
body: <p>When using SparkML to predict labels the result Dataframe is:</p>
  
  <pre><code>scala&gt; result.show
  +-----------+--------------+
  |probability|predictedLabel|
  +-----------+--------------+
  |  [0.0,1.0]|           0.0|
  |  [0.0,1.0]|           0.0|
  |  [0.0,1.0]|           0.0|
  |  [0.0,1.0]|           0.0|
  |  [0.0,1.0]|           0.0|
  |  [0.1,0.9]|           0.0|
  |  [0.0,1.0]|           0.0|
  |  [0.0,1.0]|           0.0|
  |  [0.0,1.0]|           0.0|
  |  [0.0,1.0]|           0.0|
  |  [0.0,1.0]|           0.0|
  |  [0.0,1.0]|           0.0|
  |  [0.1,0.9]|           0.0|
  |  [0.6,0.4]|           1.0|
  |  [0.6,0.4]|           1.0|
  |  [1.0,0.0]|           1.0|
  |  [0.9,0.1]|           1.0|
  |  [0.9,0.1]|           1.0|
  |  [1.0,0.0]|           1.0|
  |  [1.0,0.0]|           1.0|
  +-----------+--------------+
  only showing top 20 rows
  </code></pre>
  
  <p>I want to create a new Dataframe with a new column named prob which is the first value from the Vector in probability column of original Dataframe e.g.:</p>
  
  <pre><code>+-----------+--------------+----------+
  |probability|predictedLabel|   prob   |
  +-----------+--------------+----------+
  |  [0.0,1.0]|           0.0|       0.0|
  |  [0.0,1.0]|           0.0|       0.0|
  |  [0.0,1.0]|           0.0|       0.0|
  |  [0.0,1.0]|           0.0|       0.0|
  |  [0.0,1.0]|           0.0|       0.0|
  |  [0.1,0.9]|           0.0|       0.0|
  |  [0.0,1.0]|           0.0|       0.0|
  |  [0.0,1.0]|           0.0|       0.0|
  |  [0.0,1.0]|           0.0|       0.0|
  |  [0.0,1.0]|           0.0|       0.0|
  |  [0.0,1.0]|           0.0|       0.0|
  |  [0.0,1.0]|           0.0|       0.0|
  |  [0.1,0.9]|           0.0|       0.1|
  |  [0.6,0.4]|           1.0|       0.6|
  |  [0.6,0.4]|           1.0|       0.6|
  |  [1.0,0.0]|           1.0|       1.0|
  |  [0.9,0.1]|           1.0|       0.9|
  |  [0.9,0.1]|           1.0|       0.9|
  |  [1.0,0.0]|           1.0|       1.0|
  |  [1.0,0.0]|           1.0|       1.0|
  +-----------+--------------+----------+
  </code></pre>
  
  <p>How can extract this value into a new column?</p>