title: Split PySpark Dataframe column into multiple
body: <p>I have a pyspark dataframe column which has data as below. </p>
  
  <pre><code>Column 1
  A1,A2
  B1
  C1,C2
  D2
  </code></pre>
  
  <p>I have to split the column into 2 columns based on comma. Output Should be as below. </p>
  
  <pre><code>Column 1    Column 2
  A1          A2
              B1
  C1          C2
              D2
  </code></pre>
  
  <p>I tried using the split() function but my B1 and D2 are getting populated in column 1 instead of column 2. Is there a way to achieve the above output? </p>