title: Concatenating string by rows in pyspark
body: <p>I am having a pyspark dataframe as </p>
  
  <pre><code>DOCTOR | PATIENT
  JOHN   | SAM
  JOHN   | PETER
  JOHN   | ROBIN
  BEN    | ROSE
  BEN    | GRAY
  </code></pre>
  
  <p>and need to concatenate patient names by rows so that I get the output like:</p>
  
  <pre><code>DOCTOR | PATIENT
  JOHN   | SAM, PETER, ROBIN
  BEN    | ROSE, GRAY
  </code></pre>
  
  <p>Can anybody help me regarding creating this dataframe in pyspark ?</p>
  
  <p>Thanks in advance.</p>