I have a situation similar to that mentioned in this question.
But my complete project is in Scala and I'd prefer to exploit scala / spark-sql APIs for time and package-building-and-deployment constraints.
Do we have a method similar to pandas.DataFrame.unstack
in Scala? Or
is there some other way to achieve this, say some UDFs?