title: Pivoting a single row Spark dataframe with pivot
body: <p>I am new to spark and I want, using scala, to pivot a single row of a data frame as the following:</p>
  <pre><code>+--------------+-------+-------+-------+-------+-------+-------+-------+
  |       Country| 3/7/20| 3/8/20| 3/9/20|3/10/20|3/11/20|3/12/20|3/13/20|
  +--------------+-------+-------+-------+-------+-------+-------+-------+
  |         Japan|      0|      4|     10|     18|     27|     31|     35|
  +--------------+-------+-------+-------+-------+-------+-------+-------+
  </code></pre>
  <p>My pivoted data frame should look like the following</p>
  <pre><code>+--------------+-------+
  |       Country| Japan |
  +--------------+-------+
  |        3/7/20|      0|
  +--------------+-------+ 
  |        3/8/20|      4|
  +--------------+-------+
  |        3/9/20|     10|
  +--------------+-------+
  |       3/10/20|     18|
  +--------------+-------+
  |           ...|    ...|
  +--------------+-------+
  </code></pre>
  <p>I have tried using the following, but I am not sure I get the aggregation expression correctly:</p>
  <pre><code>val pivoted = df.groupBy(&quot;Country&quot;).pivot(&quot;Country&quot;, Seq(&quot;Japan&quot;)).agg(col(&quot;Country&quot;))
  </code></pre>