title: How to group row values into a column based on an identifier?
body: <p>Please see this example; I am trying to achieve this using spark sql/spark scala, but did not find any direct solution. Please let me know if it's not possible using Spark SQL / Spark Scala, in that case I can write a java/python program by writing a file out of As-Is.</p>
  
  <p><a href="https://i.stack.imgur.com/2dwTi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2dwTi.png" alt="enter image description here"></a></p>