title: How to flatten a struct in a Spark dataframe?
body: <p>I have a dataframe with the following structure:</p>
  
  <pre><code> |-- data: struct (nullable = true)
   |    |-- id: long (nullable = true)
   |    |-- keyNote: struct (nullable = true)
   |    |    |-- key: string (nullable = true)
   |    |    |-- note: string (nullable = true)
   |    |-- details: map (nullable = true)
   |    |    |-- key: string
   |    |    |-- value: string (valueContainsNull = true)
  </code></pre>
  
  <p>How it is possible to flatten the structure and create a new dataframe:</p>
  
  <pre><code>     |-- id: long (nullable = true)
       |-- keyNote: struct (nullable = true)
       |    |-- key: string (nullable = true)
       |    |-- note: string (nullable = true)
       |-- details: map (nullable = true)
       |    |-- key: string
       |    |-- value: string (valueContainsNull = true)
  </code></pre>
  
  <p>Is there something like explode, but for structs?</p>