title: How to split a column with comma separated values and store in array in PySpark's Dataframe? As given below
body: <p>I have a PySpark dataframe with a column that contains comma separated values. The number of values 
  that the column contains is fixed (say 4). Example:</p>
  
  <pre><code>+------------------------+
  |col1                    |
  +------------------------+
  |1,val1, val4            |
  |2,val1                  |
  |3,val1, val2, val3      |
  |4,val1, val2, val3, val4|
  +------------------------+
  </code></pre>
  
  <p>Now I want it to be split into 2 columns like below</p>
  
  <pre><code>+----+------------------------+
  |col1|col2                    |
  +----+------------------------+
  |   1|[val1, val4]            |
  |   2|[val1]                  |
  |   3|[val1, val2, val3]      |
  |   4|[val1, val2, val3, val4]|
  +----+------------------------+
  </code></pre>
  
  <p>How can this be done?</p>