title: PySpark: How to Transpose multiple columns in a Dataframe
body: <p>I am new to Spark and need a help with transposing the below input dataframe into the desired output <code>df</code> (Rows to Columns) using PySpark or Spark Sql.</p>
  <p>Input Dataframe-</p>
  <pre><code>A    B    C   D
  
  1    2    3   4
  
  10   11   12  13
  ......
  ........
  </code></pre>
  <p>Required Output (transposed) data</p>
  <pre><code>A  1
  
  B  2
  
  C  3
  
  D  4
  
  A  11
  
  B  12
  
  C  13
  
  D  14
  
  ....
  ......
  </code></pre>
  <p>It is better if I can pivot the input data (columns) as per our requirement.</p>