title: Convert Pyspark Dataframe column from array to new columns
body: <p>I've a Pyspark Dataframe with this structure:</p>
  
  <pre><code>root
   |-- Id: string (nullable = true)
   |-- Q: array (nullable = true)
   |    |-- element: struct (containsNull = true)
   |    |    |-- pr: string (nullable = true)
   |    |    |-- qt: double (nullable = true)
  </code></pre>
  
  <p>Something similar to:</p>
  
  <pre><code> +----+--------------------- ... --+
   | Id |           Q                |
   +----+---------------------- ... -+
   | 001| [ [pr1,1.9], [pr3,2.0]...] |
   | 002| [ [pr2,1.0], [pr9,3.9]...] |
   | 003| [ [pr2,9.0], ...         ] |
    ...
  </code></pre>
  
  <p>I wold like to convert Q array into columns (name pr  value qt).
  Also I would like to avoid duplicated columns by merging (add) same columns.</p>
  
  <pre><code> +----+-----+-----+------+ ... ----+
   | Id | pr1 | pr2 | pr3  | ... prn |
   +----+-----+-----+------+ ... ----+
   | 001| 1.9 | 0.0 | 2.0  | ...     |
   | 002| 0.0 | 1.0 | 0    | ...     |
   | 003| 0.0 | 9.0 | ...  | ...     |
    ...
  </code></pre>
  
  <p>How can I perform this transformation?.
  Thakyou in advance!!.
  Julián.</p>